Update test_ui_settings to use new abstraction.

This commit is contained in:
Ashish Kumar 2016-06-15 23:13:48 +05:30 committed by Tim Abbott
parent 006e528e18
commit 24767302c4
1 changed files with 2 additions and 22 deletions

View File

@ -1011,29 +1011,9 @@ class ChangeSettingsTest(AuthedTestCase):
def test_ui_settings(self):
self.login("hamlet@zulip.com")
json_result = self.client.post("/json/ui_settings/change",
{"autoscroll_forever": ujson.dumps(True)})
self.assert_json_success(json_result)
self.assertEqual(get_user_profile_by_email("hamlet@zulip.com").
enable_desktop_notifications, True)
self.check_for_toggle_param("/json/ui_settings/change", "autoscroll_forever")
json_result = self.client.post("/json/ui_settings/change",
{"autoscroll_forever": ujson.dumps(False)})
self.assert_json_success(json_result)
self.assertEqual(get_user_profile_by_email("hamlet@zulip.com").
autoscroll_forever, False)
json_result = self.client.post("/json/ui_settings/change",
{"default_desktop_notifications": ujson.dumps(True)})
self.assert_json_success(json_result)
self.assertEqual(get_user_profile_by_email("hamlet@zulip.com").
default_desktop_notifications, True)
json_result = self.client.post("/json/ui_settings/change",
{"default_desktop_notifications": ujson.dumps(False)})
self.assert_json_success(json_result)
self.assertEqual(get_user_profile_by_email("hamlet@zulip.com").
default_desktop_notifications, False)
self.check_for_toggle_param("/json/ui_settings/change", "default_desktop_notifications")
def test_missing_params(self):
"""