'Test updating each setting in UserProfile.property_types dict.'

def do_set_user_display_settings_test(self, setting_name):

    bool_change = [True, False, True]
    test_changes = dict(emojiset=[u'apple', u'twitter'], default_language=[u'es', u'de', u'en'], timezone=[u'US/Mountain', u'US/Samoa', u'Pacific/Galapogos', u''])
    property_type = UserProfile.property_types[setting_name]
    if (property_type is bool):
        validator = check_bool
    elif (property_type is Text):
        validator = check_string
    else:
        raise AssertionError(('Unexpected    property    type    %s' % (property_type,)))
    num_events = 1
    if (setting_name == 'timezone'):
        num_events = 2
    values = test_changes.get(setting_name)
    if (property_type is bool):
        values = bool_change
    if (values is None):
        raise AssertionError(('No    test    created    for    %s' % setting_name))
    for value in values:
        events = self.do_test((lambda : do_set_user_display_setting(self.user_profile, setting_name, value)), num_events=num_events)
        schema_checker = self.check_events_dict([('type', equals('update_display_settings')), ('setting_name', equals(setting_name)), ('user', check_string), ('setting', validator)])
        error = schema_checker('events[0]', events[0])
        self.assert_on_error(error)
        timezone_schema_checker = self.check_events_dict([('type', equals('realm_user')), ('op', equals('update')), ('person', check_dict_only([('email', check_string), ('user_id', check_int), ('timezone', check_string)]))])
        if (setting_name == 'timezone'):
            error = timezone_schema_checker('events[1]', events[1])
