From 10dd9addb7c39cec4b9becfb7c4a5b3904544607 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 15 Jun 2016 14:57:34 -0700 Subject: [PATCH] Fix ChangeSettingsTest caching issue causing test failures. --- zerver/tests/tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zerver/tests/tests.py b/zerver/tests/tests.py index 082aa0f844..db6a98b5b9 100644 --- a/zerver/tests/tests.py +++ b/zerver/tests/tests.py @@ -966,11 +966,14 @@ class ChangeSettingsTest(AuthedTestCase): json_result = self.client.post(pattern, {param: ujson.dumps(True)}) self.assert_json_success(json_result) + # refetch user_profile object to correctly handle caching + user_profile = get_user_profile_by_email("hamlet@zulip.com") self.assertEqual(getattr(user_profile, param), True) json_result = self.client.post(pattern, {param: ujson.dumps(False)}) self.assert_json_success(json_result) + # refetch user_profile object to correctly handle caching user_profile = get_user_profile_by_email("hamlet@zulip.com") self.assertEqual(getattr(user_profile, param), False)