From c8b8b836fdfab4ffbccba7eb474fc1e9acd22320 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Fri, 31 May 2024 10:32:00 +0530 Subject: [PATCH] test_events: Update code to test for only allowed system groups. This commit updates do_set_realm_permission_group_setting_test to test for only allowed system groups. --- zerver/tests/test_events.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 9a91749571..7cfc78123a 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -3511,6 +3511,30 @@ class RealmPropertyActionTest(BaseAction): if user_group.name == default_group_name: continue + if ( + not setting_permission_configuration.allow_internet_group + and user_group.name == SystemGroups.EVERYONE_ON_INTERNET + ): + continue + + if ( + not setting_permission_configuration.allow_everyone_group + and user_group.name == SystemGroups.EVERYONE + ): + continue + + if ( + not setting_permission_configuration.allow_owners_group + and user_group.name == SystemGroups.OWNERS + ): + continue + + if ( + not setting_permission_configuration.allow_nobody_group + and user_group.name == SystemGroups.NOBODY + ): + continue + now = timezone_now() state_change_expected = True num_events = 1