@@ -577,7 +577,7 @@ def test_push_unread_count_group_by_room(self) -> None:
577
577
# Carry out our option-value specific test
578
578
#
579
579
# This push should still only contain an unread count of 1 (for 1 unread room)
580
- self ._check_push_attempt (6 , 1 )
580
+ self ._check_push_attempt (7 , 1 )
581
581
582
582
@override_config ({"push" : {"group_unread_count_by_room" : False }})
583
583
def test_push_unread_count_message_count (self ) -> None :
@@ -591,7 +591,7 @@ def test_push_unread_count_message_count(self) -> None:
591
591
#
592
592
# We're counting every unread message, so there should now be 3 since the
593
593
# last read receipt
594
- self ._check_push_attempt (6 , 3 )
594
+ self ._check_push_attempt (7 , 3 )
595
595
596
596
def _test_push_unread_count (self ) -> None :
597
597
"""
@@ -641,18 +641,18 @@ def _test_push_unread_count(self) -> None:
641
641
response = self .helper .send (
642
642
room_id , body = "Hello there!" , tok = other_access_token
643
643
)
644
- # To get an unread count, the user who is getting notified has to have a read
645
- # position in the room. We'll set the read position to this event in a moment
644
+
646
645
first_message_event_id = response ["event_id" ]
647
646
648
647
expected_push_attempts = 1
649
- self ._check_push_attempt (expected_push_attempts , 0 )
648
+ self ._check_push_attempt (expected_push_attempts , 1 )
650
649
651
650
self ._send_read_request (access_token , first_message_event_id , room_id )
652
651
653
- # Unread count has not changed. Therefore, ensure that read request does not
654
- # trigger a push notification.
655
- self .assertEqual (len (self .push_attempts ), 1 )
652
+ # Unread count has changed. Therefore, ensure that read request triggers
653
+ # a push notification.
654
+ expected_push_attempts += 1
655
+ self .assertEqual (len (self .push_attempts ), expected_push_attempts )
656
656
657
657
# Send another message
658
658
response2 = self .helper .send (
0 commit comments