def test_unread_count_user_soft_deactivation(self) -> None:
    long_term_idle_user = self.example_user('hamlet')
    self.login(long_term_idle_user.email)
    message = 'Test Message 1'
    self.send_test_message(message)
    with queries_captured() as queries:
        self.assertEqual(self.soft_activate_and_get_unread_count(), 1)
    query_count = len(queries)
    user_msg_list = get_user_messages(long_term_idle_user)
    self.assertEqual(user_msg_list[(- 1)].content, message)
    self.logout()
    do_soft_deactivate_users([long_term_idle_user])
    self.login(long_term_idle_user.email)
    message = 'Test Message 2'
    self.send_test_message(message)
    idle_user_msg_list = get_user_messages(long_term_idle_user)
    self.assertNotEqual(idle_user_msg_list[(- 1)].content, message)
    with queries_captured() as queries:
        self.assertEqual(self.soft_activate_and_get_unread_count(), 2)
    self.assertGreaterEqual((len(queries) - query_count), 5)
    idle_user_msg_list = get_user_messages(long_term_idle_user)
    self.assertEqual(idle_user_msg_list[(- 1)].content, message)
def test_unread_count_user_soft_deactivation(self) -> None:
    long_term_idle_user = self.example_user('hamlet')
    self.login(long_term_idle_user.email)
    message = 'Test Message 1'
    self.send_test_message(message)
    with queries_captured() as queries:
        self.assertEqual(self.soft_activate_and_get_unread_count(), 1)
    query_count = len(queries)
    user_msg_list = get_user_messages(long_term_idle_user)
    self.assertEqual(user_msg_list[(- 1)].content, message)
    self.logout()
    do_soft_deactivate_users([long_term_idle_user])
    self.login(long_term_idle_user.email)
    message = 'Test Message 2'
    self.send_test_message(message)
    idle_user_msg_list = get_user_messages(long_term_idle_user)
    self.assertNotEqual(idle_user_msg_list[(- 1)].content, message)
    with queries_captured() as queries:
        self.assertEqual(self.soft_activate_and_get_unread_count(), 2)
    self.assertGreaterEqual((len(queries) - query_count), 5)
    idle_user_msg_list = get_user_messages(long_term_idle_user)
    self.assertEqual(idle_user_msg_list[(- 1)].content, message)