mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
minor flake8 fixes to rbac_display file
This commit is contained in:
@@ -68,8 +68,10 @@ class TestJobTemplateCopyEdit:
|
|||||||
def fake_context(self, user):
|
def fake_context(self, user):
|
||||||
request = RequestFactory().get('/api/v1/resource/42/')
|
request = RequestFactory().get('/api/v1/resource/42/')
|
||||||
request.user = user
|
request.user = user
|
||||||
|
|
||||||
class FakeView(object):
|
class FakeView(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
fake_view = FakeView()
|
fake_view = FakeView()
|
||||||
fake_view.request = request
|
fake_view.request = request
|
||||||
context = {}
|
context = {}
|
||||||
@@ -249,7 +251,7 @@ def test_team_roles_unattach_functional(team, team_member, inventory, get):
|
|||||||
response = get(reverse('api:team_roles_list', args=(team.id,)), team_member)
|
response = get(reverse('api:team_roles_list', args=(team.id,)), team_member)
|
||||||
# Team member should be able to remove access to inventory, becauase
|
# Team member should be able to remove access to inventory, becauase
|
||||||
# the inventory admin_role grants that ability
|
# the inventory admin_role grants that ability
|
||||||
assert response.data['results'][0]['summary_fields']['user_capabilities']['unattach'] == True
|
assert response.data['results'][0]['summary_fields']['user_capabilities']['unattach']
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_user_roles_unattach_functional(organization, alice, bob, get):
|
def test_user_roles_unattach_functional(organization, alice, bob, get):
|
||||||
@@ -257,7 +259,7 @@ def test_user_roles_unattach_functional(organization, alice, bob, get):
|
|||||||
organization.member_role.members.add(bob)
|
organization.member_role.members.add(bob)
|
||||||
response = get(reverse('api:user_roles_list', args=(alice.id,)), bob)
|
response = get(reverse('api:user_roles_list', args=(alice.id,)), bob)
|
||||||
# Org members can not revoke the membership of other members
|
# Org members can not revoke the membership of other members
|
||||||
assert response.data['results'][0]['summary_fields']['user_capabilities']['unattach'] == False
|
assert not response.data['results'][0]['summary_fields']['user_capabilities']['unattach']
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
|
|||||||
Reference in New Issue
Block a user