Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Extend test_get_accounts_for_email.

Karim Tayie7233608d4e2e
diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.py
index cb1a406f023..c33d28aa3be 100644
--- a/zerver/tests/test_users.py
+++ b/zerver/tests/test_users.py
@@ -988,6 +988,14 @@ class UserProfileTest(ZulipTestCase):
self.assert_length(accounts, 1)
check_account_present_in_accounts(self.example_user("iago"), accounts)
+ # We verify that get_accounts_for_email don't return deactivated users accounts
+ user = self.example_user("hamlet")
+ do_deactivate_user(user)
+ email = self.example_email("hamlet")
+ accounts = get_accounts_for_email(email)
+ with self.assertRaises(AssertionError):
+ check_account_present_in_accounts(user, accounts)
+
def test_get_source_profile(self) -> None:
reset_emails_in_zulip_realm()
iago = get_source_profile("[email protected]", "zulip")