mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Fix typo and update tests to catch other typos
This commit is contained in:
parent
d1008e4ccd
commit
af7762e417
@ -23,3 +23,8 @@ def test_settings():
|
|||||||
|
|
||||||
assert setting.value.startswith('$encrypted$AESCBC$')
|
assert setting.value.startswith('$encrypted$AESCBC$')
|
||||||
assert new_decrypt_field(setting, 'value') == 'test'
|
assert new_decrypt_field(setting, 'value') == 'test'
|
||||||
|
|
||||||
|
# This is here for a side-effect.
|
||||||
|
# Exception if the encryption type of AESCBC is not properly skipped, ensures
|
||||||
|
# our `startswith` calls don't have typos
|
||||||
|
replace_aesecb_fernet(apps, None)
|
||||||
|
@ -15,7 +15,7 @@ def _notification_templates(apps):
|
|||||||
for nt in NotificationTemplate.objects.all():
|
for nt in NotificationTemplate.objects.all():
|
||||||
for field in filter(lambda x: nt.notification_class.init_parameters[x]['type'] == "password",
|
for field in filter(lambda x: nt.notification_class.init_parameters[x]['type'] == "password",
|
||||||
nt.notification_class.init_parameters):
|
nt.notification_class.init_parameters):
|
||||||
if nt.notification_configuration[field].startswith('$encrypted$AESCBC4'):
|
if nt.notification_configuration[field].startswith('$encrypted$AESCBC$'):
|
||||||
continue
|
continue
|
||||||
value = decrypt_field(nt, 'notification_configuration', subfield=field)
|
value = decrypt_field(nt, 'notification_configuration', subfield=field)
|
||||||
nt.notification_configuration[field] = value
|
nt.notification_configuration[field] = value
|
||||||
|
@ -35,6 +35,11 @@ def test_notification_template_migration():
|
|||||||
assert nt.notification_configuration['token'].startswith('$encrypted$AESCBC$')
|
assert nt.notification_configuration['token'].startswith('$encrypted$AESCBC$')
|
||||||
assert decrypt_field(nt, 'notification_configuration', subfield='token') == 'test'
|
assert decrypt_field(nt, 'notification_configuration', subfield='token') == 'test'
|
||||||
|
|
||||||
|
# This is here for a side-effect.
|
||||||
|
# Exception if the encryption type of AESCBC is not properly skipped, ensures
|
||||||
|
# our `startswith` calls don't have typos
|
||||||
|
_notification_templates(apps)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_credential_migration():
|
def test_credential_migration():
|
||||||
@ -52,6 +57,11 @@ def test_credential_migration():
|
|||||||
assert cred.password.startswith('$encrypted$AESCBC$')
|
assert cred.password.startswith('$encrypted$AESCBC$')
|
||||||
assert decrypt_field(cred, 'password') == 'test'
|
assert decrypt_field(cred, 'password') == 'test'
|
||||||
|
|
||||||
|
# This is here for a side-effect.
|
||||||
|
# Exception if the encryption type of AESCBC is not properly skipped, ensures
|
||||||
|
# our `startswith` calls don't have typos
|
||||||
|
_credentials(apps)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_unified_job_migration():
|
def test_unified_job_migration():
|
||||||
@ -65,3 +75,8 @@ def test_unified_job_migration():
|
|||||||
|
|
||||||
assert uj.start_args.startswith('$encrypted$AESCBC$')
|
assert uj.start_args.startswith('$encrypted$AESCBC$')
|
||||||
assert json.loads(decrypt_field(uj, 'start_args')) == {'test':'value'}
|
assert json.loads(decrypt_field(uj, 'start_args')) == {'test':'value'}
|
||||||
|
|
||||||
|
# This is here for a side-effect.
|
||||||
|
# Exception if the encryption type of AESCBC is not properly skipped, ensures
|
||||||
|
# our `startswith` calls don't have typos
|
||||||
|
_unified_jobs(apps)
|
||||||
|
Loading…
Reference in New Issue
Block a user