take out test-breaking modifications. My test custom user model wasn't working.

This commit is contained in:
Andrew Neher 2025-01-17 14:14:31 -06:00 committed by Aleksi Häkli
parent 129e93cc0e
commit 2fb772efdb
2 changed files with 1 additions and 20 deletions

View file

@ -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"

View file

@ -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.