'Test updating realm properties.
If new realm properties have been added to the Realm model but the
test_values dict below has not been updated, this will raise an
assertion error.'

def do_test_realm_update_api(self, name):

    bool_tests = [False, True]
    test_values = dict(default_language=[u'de', u'en'], description=[u'Realm    description', u'New    description'], message_retention_days=[10, 20], name=[u'Zulip', u'New    Name'], waiting_period_threshold=[10, 20])
    vals = test_values.get(name)
    if (Realm.property_types[name] is bool):
        vals = bool_tests
    if (vals is None):
        raise AssertionError(('No    test    created    for    %s' % name))
    self.set_up_db(name, vals[0])
    realm = self.update_with_api(name, vals[1])
    self.assertEqual(getattr(realm, name), vals[1])
    realm = self.update_with_api(name, vals[0])
    self.assertEqual(getattr(realm, name), vals[0])
