Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Jul 19, 2023
1 parent 5c5b471 commit 0e69523
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iam/authmethods/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,12 +1286,13 @@ def _test_resend_auth_codes(

# resend auth code should not work as this auth event is not email-otp
# nor sms-otp and has no otp-code field
is_otp = ['email-otp', 'sms-otp'] in auth_event.auth_method
auth_event.save()
response = client.post(
f'/api/auth-event/{auth_event.id}/resend_auth_code/',
resend_auth_codes_data
)
self.assertEqual(response.status_code, 400)
self.assertEqual(response.status_code, 200 if is_otp else 400)

# Check that the number of codes associated with this voter did not
# change
Expand Down Expand Up @@ -1322,7 +1323,7 @@ def _test_resend_auth_codes(
f'/api/auth-event/{auth_event.id}/resend_auth_code/',
resend_auth_codes_data
)
self.assertEqual(response.status_code, 400)
self.assertEqual(response.status_code, 200 if is_otp else 400)

# Check that the number of codes associated with this voter did not
# change
Expand Down

0 comments on commit 0e69523

Please sign in to comment.