mirror of https://github.com/zulip/zulip.git
test_realm: Fix `test_invalid_integer_attribute_values`.
Fixes test that checks for error when invalid value is given for a property in realm. Currently, only properties with type int are checked, leaving properties having optional int type. This commit fixes that.
This commit is contained in:
parent
8bacdbc895
commit
eacf54d52d
|
@ -839,7 +839,9 @@ class RealmTest(ZulipTestCase):
|
||||||
self.assertFalse(realm.deactivated)
|
self.assertFalse(realm.deactivated)
|
||||||
|
|
||||||
def test_invalid_integer_attribute_values(self) -> None:
|
def test_invalid_integer_attribute_values(self) -> None:
|
||||||
integer_values = [key for key, value in Realm.property_types.items() if value is int]
|
integer_values = [
|
||||||
|
key for key, value in Realm.property_types.items() if value in (int, (int, type(None)))
|
||||||
|
]
|
||||||
|
|
||||||
invalid_values = dict(
|
invalid_values = dict(
|
||||||
bot_creation_policy=10,
|
bot_creation_policy=10,
|
||||||
|
@ -879,6 +881,7 @@ class RealmTest(ZulipTestCase):
|
||||||
f"Bad value for '{val_name}': {invalid_val}",
|
f"Bad value for '{val_name}': {invalid_val}",
|
||||||
f"Invalid {val_name} {invalid_val}",
|
f"Invalid {val_name} {invalid_val}",
|
||||||
f"{val_name} is too small",
|
f"{val_name} is too small",
|
||||||
|
"Must be an organization owner",
|
||||||
}
|
}
|
||||||
|
|
||||||
req = {val_name: invalid_val}
|
req = {val_name: invalid_val}
|
||||||
|
|
Loading…
Reference in New Issue