diff --git a/tests/model/test_model.py b/tests/model/test_model.py index 81bb57486e..882f98be52 100644 --- a/tests/model/test_model.py +++ b/tests/model/test_model.py @@ -126,7 +126,13 @@ def test_init_user_settings(self, mocker, initial_data, sptn, expected_sptn_valu assert "user_settings" not in initial_data # we add it in tests if sptn is not None: - initial_data["user_settings"] = {"send_private_typing_notifications": sptn} + initial_data["user_settings"] = { + "send_private_typing_notifications": sptn, + "twenty_four_hour_time": initial_data["twenty_four_hour_time"], + "pm_content_in_desktop_notifications": initial_data[ + "pm_content_in_desktop_notifications" + ], + } mocker.patch(MODEL + ".get_messages", return_value="") self.client.register = mocker.Mock(return_value=initial_data) diff --git a/zulipterminal/model.py b/zulipterminal/model.py index 1b8064fa87..240ec78f6d 100644 --- a/zulipterminal/model.py +++ b/zulipterminal/model.py @@ -235,10 +235,17 @@ def __init__(self, controller: Any) -> None: if user_settings is None else user_settings["send_private_typing_notifications"] ), # ZFL 105, Zulip 5.0 - twenty_four_hour_time=self.initial_data["twenty_four_hour_time"], - pm_content_in_desktop_notifications=self.initial_data[ - "pm_content_in_desktop_notifications" - ], + # these settings were removed from the top-level object in ZFL 439 (v12.0) + twenty_four_hour_time=( + self.initial_data["twenty_four_hour_time"] + if user_settings is None + else user_settings["twenty_four_hour_time"] + ), + pm_content_in_desktop_notifications=( + self.initial_data["pm_content_in_desktop_notifications"] + if user_settings is None + else user_settings["pm_content_in_desktop_notifications"] + ), ) self.new_user_input = True