def test_setting_partial_user_preferences_with_existing(self): """Test case for setting partial user preferences with existing :param self: self """ update = self._user_update PreferencesService.update_user_prefs(self, update, {}) self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
def test_setting_partial_user_preferences_with_existing(self): """Test case for setting partial user preferences with existing :param self: self """ update = self._user_update PreferencesService.update_user_prefs(self, update, {}) self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
def test_setting_partial_user_preferences_with_empty_existing(self): update = self._user_update existing_user_settings = { "archive:view": { "default": "mgrid", "label": "Users archive view format", "type": "string", "category": "archive", "allowed": ["mgrid", "compact"], "view": "mgrid" } } PreferencesService.update_user_prefs(self, update, existing_user_settings) self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
def test_setting_partial_user_preferences_with_empty_existing(self): update = self._user_update existing_user_settings = { "archive:view": { "default": "mgrid", "label": "Users archive view format", "type": "string", "category": "archive", "allowed": [ "mgrid", "compact" ], "view": "mgrid" } } PreferencesService.update_user_prefs(self, update, existing_user_settings) self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")