fix(2fa): fixed various typos

This commit is contained in:
RhodeCode Admin 2024-04-25 10:58:47 +02:00
parent 6b466e15b1
commit 45e456bdf0
3 changed files with 5 additions and 5 deletions

View file

@ -48,16 +48,16 @@ class Test2FA(object):
user = user_util.create_user(password=self.password)
user.has_enabled_2fa = True
user.init_secret_2fa()
recovery_cod_to_check = user.init_2fa_recovery_codes()[0]
recovery_code_to_check = user.init_2fa_recovery_codes()[0]
Session().add(user)
Session().commit()
self.app.post(
route_path('login'),
{'username': user.username,
'password': self.password})
response = self.app.post(route_path('check_2fa'), {'totp': recovery_cod_to_check})
response = self.app.post(route_path('check_2fa'), {'totp': recovery_code_to_check})
assert response.status_code == 302
response = self.app.post(route_path('check_2fa'), {'totp': recovery_cod_to_check})
response = self.app.post(route_path('check_2fa'), {'totp': recovery_code_to_check})
response.mustcontain('Code is invalid. Try again!')
def test_2fa_state_when_forced_by_admin(self, user_util):