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

Commit

Permalink
Strengthen tests about deleted old push actions. (#13471)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Aug 9, 2022
1 parent 70d3e70 commit 5ce2887
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit 5ce2887

Please sign in to comment.