Commit c213eef6 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

fixe test for django 3.1

parent 4ef943e6
Pipeline #38951 passed with stage
in 49 seconds
......@@ -143,6 +143,7 @@ class SignUpWithFirstLastNameRequiredTests(TestCase):
@override_settings(
BASETHEME_BOOTSTRAP_VALIDATE_EMAIL_BEFORE_ACTIVATION=True,
PASSWORD_RESET_TIMEOUT_DAYS=1,
PASSWORD_RESET_TIMEOUT=60*60*24,
)
class SignUpWithValidationTests(TestCase):
......@@ -200,7 +201,6 @@ class SignUpWithValidationTests(TestCase):
self.assertEqual(len(m), 1)
def test_activate_too_late_with_user_pending_resend_email(self):
get_user_model().objects.create(username="toto")
actual_account_activation_token = tokens.account_activation_token
class MockedTokenGenerator(tokens.TokenGenerator):
......@@ -209,6 +209,11 @@ class SignUpWithValidationTests(TestCase):
# Used for mocking in tests
return date.today() - timedelta(days=2)
def _now(self):
from datetime import datetime, timedelta
# Used for mocking in tests
return datetime.now() - timedelta(days=2)
tokens.account_activation_token = MockedTokenGenerator()
user_count = get_user_model().objects.count()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment