tests: Use do_change_user_role in lint rules and test docs.

This commit changes test docs and lint rules to use do_change_user_role
instead of do_change_is_admin and do_change_is_guest.
This commit is contained in:
sahil839
2020-05-28 02:43:05 +05:30
committed by Tim Abbott
parent f0c85c5796
commit 1db0775e6e
2 changed files with 3 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ influence tests results.)
Here are some example action methods that tests may use for data setup:
- check_send_message
- do_change_is_admin
- do_change_user_role
- do_create_user
- do_make_stream_private

View File

@@ -457,14 +457,14 @@ python_rules = RuleList(
'description': 'Raise CommandError to exit with failure in management commands',
},
{'pattern': '.is_realm_admin =',
'description': 'Use do_change_is_admin function rather than setting UserProfile\'s is_realm_admin attribute directly.',
'description': 'Use do_change_user_role function rather than setting UserProfile\'s is_realm_admin attribute directly.',
'exclude': {
'zerver/migrations/0248_userprofile_role_start.py',
'zerver/tests/test_users.py',
},
},
{'pattern': '.is_guest =',
'description': 'Use do_change_is_guest function rather than setting UserProfile\'s is_guest attribute directly.',
'description': 'Use do_change_user_role function rather than setting UserProfile\'s is_guest attribute directly.',
'exclude': {
'zerver/migrations/0248_userprofile_role_start.py',
'zerver/tests/test_users.py',