test_events: Use the list defined in models.py for realm update tests.

We use the lists defined in models.py like Realm.COMMON_POLICY_TYPES,
Realm.COMMON_MESSAGE_POLICY_TYPES, etc. in do_set_realm_property_test
instead of using defining list there (eg - [4, 3, 2, 1]). We do the
same thing in do_set_realm_property_test in test_realm.py.

We skip email_address_visibility values in this commit because it
requires some change in openapi schema as well.
This commit is contained in:
Sahil Batra
2021-10-04 19:44:07 +05:30
committed by Tim Abbott
parent 8123e62643
commit 402968ccf3

View File

@@ -2127,14 +2127,14 @@ class RealmPropertyActionTest(BaseAction):
message_retention_days=[10, 20],
name=["Zulip", "New Name"],
waiting_period_threshold=[10, 20],
create_public_stream_policy=[4, 3, 2, 1],
create_private_stream_policy=[4, 3, 2, 1],
invite_to_stream_policy=[4, 3, 2, 1],
private_message_policy=[2, 1],
user_group_edit_policy=[1, 2, 3, 4],
wildcard_mention_policy=[7, 6, 5, 4, 3, 2, 1],
create_public_stream_policy=Realm.COMMON_POLICY_TYPES,
create_private_stream_policy=Realm.COMMON_POLICY_TYPES,
invite_to_stream_policy=Realm.COMMON_POLICY_TYPES,
private_message_policy=Realm.PRIVATE_MESSAGE_POLICY_TYPES,
user_group_edit_policy=Realm.COMMON_POLICY_TYPES,
wildcard_mention_policy=Realm.WILDCARD_MENTION_POLICY_TYPES,
email_address_visibility=[Realm.EMAIL_ADDRESS_VISIBILITY_ADMINS],
bot_creation_policy=[Realm.BOT_CREATION_EVERYONE],
bot_creation_policy=Realm.BOT_CREATION_POLICY_TYPES,
video_chat_provider=[
Realm.VIDEO_CHAT_PROVIDERS["jitsi_meet"]["id"],
],
@@ -2143,10 +2143,10 @@ class RealmPropertyActionTest(BaseAction):
],
default_code_block_language=["python", "javascript"],
message_content_delete_limit_seconds=[1000, 1100, 1200],
invite_to_realm_policy=[6, 4, 3, 2, 1],
move_messages_between_streams_policy=[4, 3, 2, 1],
add_custom_emoji_policy=[4, 3, 2, 1],
delete_own_message_policy=[5, 4, 3, 2, 1],
invite_to_realm_policy=Realm.INVITE_TO_REALM_POLICY_TYPES,
move_messages_between_streams_policy=Realm.COMMON_POLICY_TYPES,
add_custom_emoji_policy=Realm.COMMON_POLICY_TYPES,
delete_own_message_policy=Realm.COMMON_MESSAGE_POLICY_TYPES,
)
vals = test_values.get(name)