'The main complicated thing about deactivating realm names is
updating the cache, and we start by populating the cache for
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().'

def test_do_deactivate_realm_clears_user_realm_cache(self):

    self.example_user('hamlet')
    realm = get_realm('zulip')
    do_deactivate_realm(realm)
    user = self.example_user('hamlet')
    self.assertTrue(user.realm.deactivated)
