test_events: Update `realm` before fetching normal_states in `do_test`.

As a follow up of this commit (99a2c21ff3),
we now are refreshing `realm` and its attributes before fetching
normal_state in `do_test` function using
`self.user_profile.realm.refresh_from_db()`, resulting in updated `realm`
values, so that now even if we use `get_realm` as before, tests wouldn't
fail as now any changes to `Realm` table after applying action get
reflected to `realm` attribute of `self.user_profile` by refreshing.
This commit is contained in:
Pragati Agrawal 2019-03-11 11:06:08 +05:30
parent 7b6a37780a
commit 27835ecaab
1 changed files with 1 additions and 0 deletions

View File

@ -524,6 +524,7 @@ class EventsRegisterTest(ZulipTestCase):
if before != after:
raise AssertionError('Test is invalid--state actually does change here.')
self.user_profile.realm.refresh_from_db()
normal_state = fetch_initial_state_data(
self.user_profile, event_types, "",
client_gravatar=True,