tests: Extend test_get_accounts_for_email.

This extends get_accounts_for_email test by adding a deactivated
user and assert that get_accounts_for_email doesn't return any accounts
for that deactivated user.

Fixes #14807.
This commit is contained in:
Karim Tayie
2020-06-19 03:13:52 +02:00
committed by Tim Abbott
parent d0417ffdbb
commit 7233608d4e

View File

@@ -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("iago@zulip.com", "zulip")