def test_invalid_kind_clean_insights_credential(): cred_type = CredentialType.defaults['insights']() insights_cred = Credential(credential_type=cred_type) inv = Inventory(kind='smart', insights_credential=insights_cred) with pytest.raises(ValidationError) as e: inv.clean_insights_credential() assert json.dumps(str(e.value)) == json.dumps(str([u'Assignment not allowed for Smart Inventory']))
def test_invalid_clean_insights_credential(): cred_type = CredentialType.defaults['scm']() cred = Credential(credential_type=cred_type) inv = Inventory(insights_credential=cred) with pytest.raises(ValidationError) as e: inv.clean_insights_credential() assert json.dumps(str(e.value)) == json.dumps(str([u"Credential kind must be 'insights'."]))
def test_valid_kind_clean_insights_credential(): inv = Inventory(kind='smart') inv.clean_insights_credential()
def test_valid_clean_insights_credential(): cred_type = CredentialType.defaults['insights']() insights_cred = Credential(credential_type=cred_type) inv = Inventory(insights_credential=insights_cred) inv.clean_insights_credential()