TNl-6610 Fix "more" menu on discussion post for global staff.
This commit is contained in:
@@ -1405,6 +1405,26 @@ class PermissionsTestCase(ModuleStoreTestCase):
|
||||
'can_report': True
|
||||
})
|
||||
|
||||
def test_get_ability_with_global_staff(self):
|
||||
"""
|
||||
Tests that global staff has rights to report other user's post inspite
|
||||
of enrolled in the course or not.
|
||||
"""
|
||||
content = {'user_id': '1', 'type': 'thread'}
|
||||
|
||||
with mock.patch('django_comment_client.utils.check_permissions_by_view') as check_perm:
|
||||
# check_permissions_by_view returns false because user is not enrolled in the course.
|
||||
check_perm.return_value = False
|
||||
global_staff = UserFactory(username='global_staff', email='global_staff@edx.org', is_staff=True)
|
||||
self.assertEqual(utils.get_ability(None, content, global_staff), {
|
||||
'editable': False,
|
||||
'can_reply': False,
|
||||
'can_delete': False,
|
||||
'can_openclose': False,
|
||||
'can_vote': False,
|
||||
'can_report': True
|
||||
})
|
||||
|
||||
def test_is_content_authored_by(self):
|
||||
content = {}
|
||||
user = mock.Mock()
|
||||
|
||||
Reference in New Issue
Block a user