Opened 13 years ago
Closed 13 years ago
#16413 closed Bug (fixed)
changing settings.LOGIN_URL to end with something different than /login/, causes an error in testing your app
Reported by: | Matt Harasymczuk | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | djangoproject.com@…, bjornkri@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
Try changing settings.LOGIN_URL to end with something different than /login/ for example to signup or /admin/ (as it is in my case). You'll get an error in testing your app (django.contrib.auth.tests.views.ChangePasswordTest)
Attachments (1)
Change History (6)
comment:1 by , 13 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 13 years ago
Attachment: | 16413.diff added |
---|
comment:2 by , 13 years ago
Patch needs improvement: | set |
---|
I agree that only auth
's tests need fixing. However, the tests would be more robust if they explicitly overrode the LOGIN_URL
setting.
comment:4 by , 13 years ago
Cc: | added |
---|
Note:
See TracTickets
for help on using tickets.
This doesn't happen when you run the test suite because
runtests.py
setssettings.LOGIN_URL = '/accounts/login/'
(line 119). Changing it causes 12 test failures.The 6 failures in
modeltests
and the 5 failures inregressiontests
don't matter, because these tests are only supposed to be run byruntests.py
.The failure in
django.contrib.auth.tests
does, because this test may be run by./manage.py test
, and then the value ofsettings.LOGIN_URL
won't be enforced.