Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_outdated_login fails on Django 5.1 - problems with redirect? #309

Open
MeggyCal opened this issue Nov 8, 2024 · 1 comment
Open

Comments

@MeggyCal
Copy link

MeggyCal commented Nov 8, 2024

Hi, I tried to update your package in our environment (Django 5.1), but came across a test failure:

[   21s] =================================== FAILURES ===================================
[   21s] _______________ TestRecentLoginRequiredMixin.test_outdated_login _______________
[   21s] 
[   21s] self = <tests.test_access_mixins.TestRecentLoginRequiredMixin testMethod=test_outdated_login>
[   21s] 
[   21s]     def test_outdated_login(self):
[   21s]         """An outdated login should get a 302"""
[   21s]         self.view_class.max_last_login_delta = 0
[   21s]         last_login = datetime.datetime.now() - datetime.timedelta(hours=2)
[   21s]         last_login = make_aware(last_login, get_current_timezone())
[   21s]         user = UserFactory(last_login=last_login)
[   21s]         self.client.login(username=user.username, password="asdf1234")
[   21s]         resp = self.client.get(self.outdated_view_url)
[   21s] >       assert resp.status_code == 302
[   21s] E       assert 405 == 302
[   21s] E        +  where 405 = <HttpResponseNotAllowed [POST, OPTIONS] status_code=405, "text/html; charset=utf-8">.status_code
[   21s] 
[   21s] tests/test_access_mixins.py:772: AssertionError
[   21s] ------------------------------ Captured log call -------------------------------
[   21s] WARNING  django.request:base.py:146 Method Not Allowed (GET): /outdated_login/
[   21s] WARNING  django.request:log.py:248 Method Not Allowed: /outdated_login/

Although I can't tell the cause with certainty, it looks remarkably similar to this problem: juanifioren/django-oidc-provider#416 (also the test failures were similar in my environment). Could you please take a look at it?

@MeggyCal
Copy link
Author

MeggyCal commented Nov 8, 2024

ATM I am OK with just skipping the test and moving on, so no pressure from my side :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant