handle credential.inputs in decryption utils

This commit is contained in:
Jake McDermott
2019-01-21 18:03:56 -05:00
parent 6772c81927
commit a8728670e1
6 changed files with 54 additions and 13 deletions

View File

@@ -2,6 +2,8 @@
# Copyright (c) 2017 Ansible, Inc.
# All Rights Reserved.
import pytest
from awx.conf.models import Setting
from awx.main.utils import encryption
@@ -45,6 +47,16 @@ def test_encrypt_field_with_empty_value():
assert encrypted is None
def test_encrypt_field_with_undefined_attr_raises_expected_exception():
with pytest.raises(AttributeError):
encryption.encrypt_field({}, 'undefined_attr')
def test_decrypt_field_with_undefined_attr_raises_expected_exception():
with pytest.raises(AttributeError):
encryption.decrypt_field({}, 'undefined_attr')
class TestSurveyReversibilityValue:
'''
Tests to enforce the contract with survey password question encrypted values