From bc72d2dbc4b5ec44eb91055c7848d5d63ee6d0bd Mon Sep 17 00:00:00 2001 From: sahil839 Date: Sun, 21 Mar 2021 23:17:10 +0530 Subject: [PATCH] tests: Remove unnecessary use of do_change_user_role in test_subs. This commit removes the unnecessary do_change_user_role function in test_can_subcribe_other_users. This was added in 1aebf3cab which replaced the multiple functions like do_change_is_admin and do_change_is_guest with do_change_user_role. Previously two functions do_change_is_admin and do_change_is_guest were used because there were two flags is_realm_admin and is_guest which were used to determine the role of a user. But then we added a single field role to UserProfile and removed the multiple flags and thus also replaced the different functions with a single do_change_user_role. With addition of a new field role, two different do_change_* functions were not needed as we only have a role field instead of different flags, but this was missed in 1aebf3cab and this commit fixes it. --- zerver/tests/test_subs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py index c8148c3c8a..7d050d7e33 100644 --- a/zerver/tests/test_subs.py +++ b/zerver/tests/test_subs.py @@ -3285,7 +3285,6 @@ class SubscriptionAPITest(ZulipTestCase): do_change_user_role(othello, UserProfile.ROLE_REALM_ADMINISTRATOR) self.assertTrue(othello.can_subscribe_other_users()) - do_change_user_role(othello, UserProfile.ROLE_MEMBER) do_change_user_role(othello, UserProfile.ROLE_GUEST) self.assertFalse(othello.can_subscribe_other_users())