fix:warnung Löschfrist
This commit is contained in:
1 parent
8b383d2552
commit
d718543169
5 files changed
+31
-2
No files matched your search
@@ -140,4 +140,7 @@ def test_settings_show_planned_date(app: Any) -> None:
|
||||
page = carla.get(f"/forms/{pid}/settings").text
|
||||
assert "The answers will be anonymized on" in page
|
||||
assert "default of this installation (730 days)" in page
|
||||
# Hinweis auf der Antwortenseite erst drei Monate vor dem Ende der Frist
|
||||
assert "The retention period ends" not in carla.get(f"/forms/{pid}/responses").text
|
||||
shift_end(pid, days_ago=10, retention_days=60)
|
||||
assert "The retention period ends" in carla.get(f"/forms/{pid}/responses").text
|
||||
@@ -60,3 +60,18 @@ def test_default_period_and_planned_date() -> None:
|
||||
long = form(retention_days=400)
|
||||
assert retention.planned_date(db, long, NOW) == NOW - timedelta(days=10) + timedelta(days=400)
|
||||
assert retention.planned_date(db, form(status="draft"), NOW) is None
|
||||
|
||||
|
||||
def test_notice_only_in_the_last_three_months() -> None:
|
||||
db: Any = NoSettings()
|
||||
# Frist endet in 20 Tagen: Hinweis
|
||||
soon = form(retention_days=30)
|
||||
assert retention.upcoming_date(db, soon, NOW) == retention.planned_date(db, soon, NOW)
|
||||
# Frist endet in rund 2 Jahren (Standard): kein Hinweis, das Datum bleibt planbar
|
||||
later = form(retention_days=None)
|
||||
assert retention.planned_date(db, later, NOW) is not None
|
||||
assert retention.upcoming_date(db, later, NOW) is None
|
||||
# Genau an der Grenze von drei Monaten: Hinweis
|
||||
edge = form(closed_at=NOW, retention_days=90)
|
||||
assert retention.upcoming_date(db, edge, NOW) == NOW + retention.WARN_BEFORE
|
||||
assert retention.upcoming_date(db, form(closed_at=NOW, retention_days=91), NOW) is None
|
||||
Reference in new issue
Block a user