mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Fix tests broken by twenty-four-hour-time feature.
(imported from commit 4f6215b303de8e27323141f687e046048f1456b5)
This commit is contained in:
@@ -1722,6 +1722,7 @@ def do_change_twenty_four_hour_time(user_profile, twenty_four_hour_time, log=Tru
|
|||||||
user_profile.save(update_fields=["twenty_four_hour_time"])
|
user_profile.save(update_fields=["twenty_four_hour_time"])
|
||||||
event = {'type': 'update_display_settings',
|
event = {'type': 'update_display_settings',
|
||||||
'user': user_profile.email,
|
'user': user_profile.email,
|
||||||
|
'setting_name': 'twenty_four_hour_time',
|
||||||
'setting': twenty_four_hour_time}
|
'setting': twenty_four_hour_time}
|
||||||
if log:
|
if log:
|
||||||
log_event(event)
|
log_event(event)
|
||||||
@@ -2503,7 +2504,8 @@ def apply_events(state, events, user_profile):
|
|||||||
elif event['type'] == "realm_filters":
|
elif event['type'] == "realm_filters":
|
||||||
state['realm_filters'] = event["realm_filters"]
|
state['realm_filters'] = event["realm_filters"]
|
||||||
elif event['type'] == "update_display_settings":
|
elif event['type'] == "update_display_settings":
|
||||||
state['twenty_four_hour_time'] == event["twenty_four_hour_time"]
|
if event['setting_name'] == "twenty_four_hour_time":
|
||||||
|
state['twenty_four_hour_time'] = event["setting"]
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unexpected event type %s" % (event['type'],))
|
raise ValueError("Unexpected event type %s" % (event['type'],))
|
||||||
|
|
||||||
|
|||||||
@@ -438,11 +438,9 @@ class EventsRegisterTest(AuthedTestCase):
|
|||||||
def test_change_twenty_four_hour_time(self):
|
def test_change_twenty_four_hour_time(self):
|
||||||
schema_checker = check_dict([
|
schema_checker = check_dict([
|
||||||
('type', equals('update_display_settings')),
|
('type', equals('update_display_settings')),
|
||||||
('op', equals('update')),
|
('setting_name', equals('twenty_four_hour_time')),
|
||||||
('person', check_dict([
|
('user', check_string),
|
||||||
('email', check_string),
|
('setting', check_bool),
|
||||||
('twenty_four_hour_time', check_bool),
|
|
||||||
])),
|
|
||||||
])
|
])
|
||||||
# The first False is probably a noop, then we get transitions in both directions.
|
# The first False is probably a noop, then we get transitions in both directions.
|
||||||
for twenty_four_hour_time in [False, True, False]:
|
for twenty_four_hour_time in [False, True, False]:
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ add_dependencies({
|
|||||||
util: 'js/util.js'
|
util: 'js/util.js'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
set_global('page_params', {
|
||||||
|
twenty_four_hour_time: false
|
||||||
|
});
|
||||||
set_global('home_msg_list', null);
|
set_global('home_msg_list', null);
|
||||||
set_global('feature_flags', {twenty_four_hour_time: false});
|
set_global('feature_flags', {twenty_four_hour_time: false});
|
||||||
set_global('ui', {small_avatar_url: function () { return ''; }});
|
set_global('ui', {small_avatar_url: function () { return ''; }});
|
||||||
|
|||||||
Reference in New Issue
Block a user