From 2fb772efdbd942e9f70cd7d884b0df3f94f06b7d Mon Sep 17 00:00:00 2001 From: Andrew Neher Date: Fri, 17 Jan 2025 14:14:31 -0600 Subject: [PATCH] take out test-breaking modifications. My test custom user model wasn't working. --- tests/base.py | 8 -------- tests/test_login.py | 13 +------------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/tests/base.py b/tests/base.py index d1cd8cd..5618316 100644 --- a/tests/base.py +++ b/tests/base.py @@ -195,11 +195,3 @@ class AxesTestCase(TestCase): self.cool_off() self.check_login() self.check_logout() - - -class CustomTestUserModel(AbstractBaseUser): - class Meta: - app_label = "tests" - db_table = "auth_user" - USERNAME_FIELD = "email" - \ No newline at end of file diff --git a/tests/test_login.py b/tests/test_login.py index 4b17433..80b602f 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -15,7 +15,7 @@ from django.urls import reverse from axes.conf import settings from axes.helpers import get_cache, make_cache_key_list, get_cool_off, get_failure_limit from axes.models import AccessAttempt -from tests.base import AxesTestCase, CustomTestUserModel +from tests.base import AxesTestCase class DjangoLoginTestCase(TestCase): @@ -145,17 +145,6 @@ class DatabaseLoginTestCase(AxesTestCase): response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True ) - @override_settings(AUTH_USER_MODEL='tests.CustomTestUserModel') - def test_custom_user_model_login(self): - """ - Test a valid login for a custom username field on a custom user model. - """ - - response = self._login(self.email, self.password) - self.assertNotContains( - response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True - ) - def test_lockout_limit_once(self): """ Test the login lock trying to login one more time than failure limit.