Fix some issues with updating user email defaults

Change-Id: I8d33f0b0f13eba64569a17836bb2ca5ffb9f1c93
This commit is contained in:
Adrian Turjak 2021-10-26 16:10:58 +13:00
parent bee1e42c9f
commit ec6c2c6d1d
2 changed files with 3 additions and 2 deletions

View File

@ -967,7 +967,7 @@ class DelegateAPITests(AdjutantAPITestCase):
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.json(), {"notes": ["task created"]})
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(len(mail.outbox), 2)
new_token = Token.objects.all()[0]
url = "/v1/tokens/" + new_token.token
@ -976,6 +976,7 @@ class DelegateAPITests(AdjutantAPITestCase):
response = self.client.post(url, data, format="json")
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(user.email, "new_test@example.com")
self.assertEqual(len(mail.outbox), 3)
def test_update_email_task_not_authenticated(self):
"""

View File

@ -77,7 +77,7 @@ class UpdateUserEmail(BaseTask):
]
action_config = {
"SendAdditionalEmailAction": {
"initial": {
"prepare": {
"subject": "OpenStack Email Update Requested",
"template": "update_user_email_started.txt",
"email_current_user": True,