fix: restore tubco user onboarding access
Some checks failed
CI / python-validation (push) Has been cancelled
CI / docker-release-gate (push) Has been cancelled
i18n / compile-translations (push) Has been cancelled

This commit is contained in:
Md Bayazid Bostame
2026-04-08 13:38:30 +02:00
parent 0a38e04606
commit b60d9eaeb7
4 changed files with 87 additions and 1 deletions

View File

@@ -32,6 +32,10 @@ class AccountUISmokeTests(TestCase):
def test_user_profile_is_created_automatically(self):
self.assertTrue(UserProfile.objects.filter(user=self.user).exists())
profile = UserProfile.objects.get(user=self.user)
self.assertEqual(profile.temporary_role_key, '')
self.assertIsNone(profile.temporary_role_expires_at)
self.assertEqual(profile.temporary_role_reason, '')
def test_notification_preferences_can_be_updated(self):
response = self.client.post(
@@ -179,3 +183,14 @@ class AccountUISmokeTests(TestCase):
self.assertEqual(response.status_code, 302)
profile.refresh_from_db()
self.assertEqual(profile.totp_recovery_codes, [])
def test_login_accepts_email_after_password_is_set(self):
client = Client()
response = client.post(
'/accounts/login/',
{'username': 'profile@example.com', 'password': 'secret-12345'},
HTTP_HOST='localhost',
)
self.assertEqual(response.status_code, 302)