Add option update_password (always, on_create) to tower_user module

This commit is contained in:
Nicolas Payart
2020-06-20 10:45:41 +02:00
committed by Alan Rominger
parent ef3a497c42
commit 8e97214309
2 changed files with 23 additions and 1 deletions

View File

@@ -44,3 +44,16 @@ def test_password_no_op_warning(run_module, admin_user, mock_auth_stuff, silence
silence_warning.assert_called_once_with(
"The field password of user {0} has encrypted data and "
"may inaccurately report task is changed.".format(result['id']))
@pytest.mark.django_db
def test_update_password_on_create(run_module, admin_user, mock_auth_stuff):
for i in range(2):
result = run_module('tower_user', dict(
username='Bob',
password='pass4word',
update_password='on_create'
), admin_user)
assert not result.get('failed', False), result.get('msg', result)
assert not result.get('changed')