Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Strengthen tests about deleted old push actions. #13471

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13471.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clean-up tests for notifications.
15 changes: 15 additions & 0 deletions tests/storage/test_event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,22 @@ def _mark_read(event_id: str) -> None:
_assert_counts(1, 1, 0)

# Delete old event push actions, this should not affect the (summarised) count.
#
# All event push actions are kept for 24 hours, so need to move forward
# in time.
self.pump(60 * 60 * 24)
self.get_success(self.store._remove_old_push_actions_that_have_rotated())
# Double check that the event push actions have been cleared (i.e. that
# any results *must* come from the summary).
result = self.get_success(
self.store.db_pool.simple_select_list(
table="event_push_actions",
keyvalues={"1": 1},
retcols=("event_id",),
desc="",
)
)
self.assertEqual(result, [])
_assert_counts(1, 1, 0)

_mark_read(last_event_id)
Expand Down