diff --git a/basetheme_bootstrap/tests.py b/basetheme_bootstrap/tests.py index ba8fb89f1823ccf52e21bb30f17b7abc80e1c3f5..c2f9beaef7c16c707cde0b0f00299abe127a275d 100644 --- a/basetheme_bootstrap/tests.py +++ b/basetheme_bootstrap/tests.py @@ -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()