mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
assert Credential unique_togehter works
This commit is contained in:
15
awx/main/tests/functional/test_credential.py
Normal file
15
awx/main/tests/functional/test_credential.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
from django.db import IntegrityError
|
||||||
|
from awx.main.models import Credential
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_cred_unique_org_name_kind(organization_factory):
|
||||||
|
objects = organization_factory("test")
|
||||||
|
|
||||||
|
cred = Credential(name="test", kind="net", organization=objects.organization)
|
||||||
|
cred.save()
|
||||||
|
|
||||||
|
with pytest.raises(IntegrityError):
|
||||||
|
cred = Credential(name="test", kind="net", organization=objects.organization)
|
||||||
|
cred.save()
|
||||||
Reference in New Issue
Block a user