Skip to content

test_backup_status view tests fail after 2026-08-08 (hard-coded fixture timestamp goes stale) #1450

Description

@jonfroehlich

AdminBackupWarningTests in website/tests/test_backup_status.py writes a status
fixture with hard-coded timestamps:

'last_backup_at': '2026-08-07T03:00:00Z',

The sibling SimpleTestCase suites are fine — they call
get_backup_status(..., now=NOW) with a matching fixed clock. But
AdminBackupWarningTests goes through the real admin views, which call
get_backup_status() with the real clock. With
BACKUP_STALE_AFTER_HOURS = 36, that fixture reads as stale from
2026-08-08 onward, so these two tests fail on every run after that date:

  • test_no_warning_when_backup_healthy — "'database backups are not healthy'
    unexpectedly found"
  • test_data_health_panel_always_shown_even_when_healthy — "Couldn't find 'Healthy'"

Master's CI last passed on 2026-08-07 (the run for the #1443 merge itself) and
has been red since. Caught while trying to merge #1449.

Fix: make the view suite's fixture timestamps relative to datetime.now(timezone.utc)
(a few hours old = healthy), leaving the fixed-clock unit suites alone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions