stages/authenticator_email: fix session cleanup test b (cherry-pick #13264) (#13276)

Co-authored-by: Marcelo Elizeche Landó <marcelo@goauthentik.io>
fix session cleanup test b (#13264)
This commit is contained in:
gcp-cherry-pick-bot[bot]
2025-02-26 20:46:05 +01:00
committed by GitHub
parent 1f1db523c0
commit 8b619635ea

View File

@ -300,9 +300,11 @@ class TestAuthenticatorEmailStage(FlowTestCase):
)
self.assertEqual(response.status_code, 200)
self.assertTrue(device.confirmed)
# Session key should be removed after device is saved
device.save()
self.assertNotIn(SESSION_KEY_EMAIL_DEVICE, self.client.session)
# Get a fresh session to check if the key was removed
session = self.client.session
session.save()
session.load()
self.assertNotIn(SESSION_KEY_EMAIL_DEVICE, session)
def test_model_properties_and_methods(self):
"""Test model properties"""