From fe9952eab5b668362f22e577db82430f1597f9aa Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Thu, 24 Oct 2024 13:32:00 +0000 Subject: [PATCH] groups: Rename test to state that it checks allow_system_group. We also remove the default group check which is already being checked in do_set_realm_permission_group_setting_to_anonymous_groups_test. --- zerver/tests/test_events.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 8a0bbe496e..905caed49f 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -3794,7 +3794,7 @@ class RealmPropertyActionTest(BaseAction): else: check_realm_update("events[0]", events[0], name) - def do_set_realm_permission_group_setting_test(self, setting_name: str) -> None: + def do_test_allow_system_group(self, setting_name: str) -> None: all_system_user_groups = NamedUserGroup.objects.filter( realm=self.user_profile.realm, is_system_group=True, @@ -3808,22 +3808,6 @@ class RealmPropertyActionTest(BaseAction): now = timezone_now() - do_change_realm_permission_group_setting( - self.user_profile.realm, - setting_name, - default_group, - acting_user=self.user_profile, - ) - - self.assertEqual( - RealmAuditLog.objects.filter( - realm=self.user_profile.realm, - event_type=AuditLogEventType.REALM_PROPERTY_CHANGED, - event_time__gte=now, - acting_user=self.user_profile, - ).count(), - 1, - ) for user_group in all_system_user_groups: if user_group.name == default_group_name: continue @@ -4037,7 +4021,7 @@ class RealmPropertyActionTest(BaseAction): for prop in Realm.REALM_PERMISSION_GROUP_SETTINGS: with self.settings(SEND_DIGEST_EMAILS=True): - self.do_set_realm_permission_group_setting_test(prop) + self.do_test_allow_system_group(prop) if Realm.REALM_PERMISSION_GROUP_SETTINGS[prop].require_system_group: # Anonymous system groups aren't relevant when # restricted to system groups.