Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Oct 2, 2023
1 parent b123c05 commit ff0750a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions backend/api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def test_post__otp(self):

assert response.status_code == 200
self.assertDictEqual(
response.json(), {"auth_factors": [AuthFactor.Type.OTP]}
response.json(),
{
"auth_factors": [AuthFactor.Type.OTP],
"otp_bypass_token_exists": False,
},
)

self.user.userprofile.otp_secret = pyotp.random_base32()
Expand All @@ -45,7 +49,13 @@ def test_post__otp(self):
)

assert response.status_code == 200
self.assertDictEqual(response.json(), {"auth_factors": []})
self.assertDictEqual(
response.json(),
{
"auth_factors": [],
"otp_bypass_token_exists": False,
},
)


class TestClearExpiredView(CronTestCase):
Expand Down

0 comments on commit ff0750a

Please sign in to comment.