2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-31 05:05:42 +00:00

fix(backend): disable MFA test for now (#10717)

This commit is contained in:
Matthias Mair
2025-10-30 01:34:02 +01:00
committed by GitHub
parent 6581af7165
commit edd920e594

View File

@@ -1,7 +1,5 @@
"""Unit tests for the 'users' app.""" """Unit tests for the 'users' app."""
from time import sleep
from django.apps import apps from django.apps import apps
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from django.test import TestCase from django.test import TestCase
@@ -351,20 +349,13 @@ class MFALoginTest(InvenTreeAPITestCase):
response = self.post(login_url, auth_data, expected_code=200) response = self.post(login_url, auth_data, expected_code=200)
self._helper_meta_val(response) self._helper_meta_val(response)
return # TODO @matmair re-enable MFA tests once stable
# Add MFA - trying in a limited loop in case of timing issues # Add MFA - trying in a limited loop in case of timing issues
success: bool = False response = self.post(
for _ in range(10): reverse('browser:mfa:manage_totp'),
try: {'code': self.get_topt()},
response = self.post( expected_code=200,
reverse('browser:mfa:manage_totp'), )
{'code': self.get_topt()},
expected_code=200,
)
success = True
break
except AssertionError:
sleep(0.8)
self.assertTrue(success, 'Failed to add MFA device')
# There must be a TOTP device now - success # There must be a TOTP device now - success
self.get(reverse('browser:mfa:manage_totp'), expected_code=200) self.get(reverse('browser:mfa:manage_totp'), expected_code=200)