test_realm: Fix test_do_deactivate_realm_clears_user_realm_cache.

self.example_user("hamlet") uses get_user_by_delivery_email, so it
doesn't actually cache anything. This should use a cached function, like
the test below: test_do_change_realm_subdomain_clears_user_realm_cache.
This commit is contained in:
Mateusz Mandera 2021-03-01 19:00:31 +01:00 committed by Tim Abbott
parent faf314c8d3
commit 132ce525b1
1 changed files with 2 additions and 2 deletions

View File

@ -179,10 +179,10 @@ class RealmTest(ZulipTestCase):
Hamlet, and we end by checking the cache to ensure that his
realm appears to be deactivated. You can make this test fail
by disabling cache.flush_realm()."""
self.example_user("hamlet")
get_user_profile_by_email("hamlet@zulip.com")
realm = get_realm("zulip")
do_deactivate_realm(realm)
user = self.example_user("hamlet")
user = get_user_profile_by_email("hamlet@zulip.com")
self.assertTrue(user.realm.deactivated)
def test_do_change_realm_subdomain_clears_user_realm_cache(self) -> None: