mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
Merge pull request #3370 from ansible/AlanCoding-patch-3
test_credential bug fixes
This commit is contained in:
@@ -319,18 +319,18 @@ def test_cant_change_organization(patch, credential, organization, org_admin):
|
|||||||
credential.organization = organization
|
credential.organization = organization
|
||||||
credential.save()
|
credential.save()
|
||||||
|
|
||||||
response = patch(reverse('api:credential_detail', args=(organization.id,)), {
|
response = patch(reverse('api:credential_detail', args=(credential.id,)), {
|
||||||
'name': 'Some new name',
|
'name': 'Some new name',
|
||||||
}, org_admin)
|
}, org_admin)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
response = patch(reverse('api:credential_detail', args=(organization.id,)), {
|
response = patch(reverse('api:credential_detail', args=(credential.id,)), {
|
||||||
'name': 'Some new name2',
|
'name': 'Some new name2',
|
||||||
'organization': organization.id, # fine for it to be the same
|
'organization': organization.id, # fine for it to be the same
|
||||||
}, org_admin)
|
}, org_admin)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
response = patch(reverse('api:credential_detail', args=(organization.id,)), {
|
response = patch(reverse('api:credential_detail', args=(credential.id,)), {
|
||||||
'name': 'Some new name3',
|
'name': 'Some new name3',
|
||||||
'organization': None
|
'organization': None
|
||||||
}, org_admin)
|
}, org_admin)
|
||||||
@@ -339,7 +339,7 @@ def test_cant_change_organization(patch, credential, organization, org_admin):
|
|||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_cant_add_organization(patch, credential, organization, org_admin):
|
def test_cant_add_organization(patch, credential, organization, org_admin):
|
||||||
assert credential.organization is None
|
assert credential.organization is None
|
||||||
response = patch(reverse('api:credential_detail', args=(organization.id,)), {
|
response = patch(reverse('api:credential_detail', args=(credential.id,)), {
|
||||||
'name': 'Some new name',
|
'name': 'Some new name',
|
||||||
'organization': organization.id
|
'organization': organization.id
|
||||||
}, org_admin)
|
}, org_admin)
|
||||||
|
|||||||
Reference in New Issue
Block a user