require that insights projects have insights cred

This commit is contained in:
Chris Meyers
2017-07-12 12:24:11 -04:00
parent 25632c03a4
commit 376170124e
2 changed files with 18 additions and 1 deletions
@@ -0,0 +1,15 @@
import pytest
import json
from awx.main.models import (
Project,
)
from django.core.exceptions import ValidationError
def test_clean_credential_insights():
proj = Project(name="myproj", credential=None, scm_type='insights')
with pytest.raises(ValidationError) as e:
proj.clean_credential()
assert json.dumps(str(e.value)) == json.dumps(str([u'Insights Credential is required for an Insights Project.']))