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)

16413.diff (648 bytes ) - added by Aymeric Augustin 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Aymeric Augustin, 13 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

This doesn't happen when you run the test suite because runtests.py sets settings.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 by runtests.py.

The failure in django.contrib.auth.tests does, because this test may be run by ./manage.py test, and then the value of settings.LOGIN_URL won't be enforced.

by Aymeric Augustin, 13 years ago

Attachment: 16413.diff added

comment:2 by Julien Phalip, 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:3 by Aymeric Augustin, 13 years ago

#16517 was a duplicate.

comment:4 by Bjorn Kristinsson, 13 years ago

Cc: bjornkri@… added

comment:5 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

In [16552]:

Fixed #16413 -- Stopped an auth test from failing if LOGIN_URL is set to a non-default value. Thanks, Aymeric Augustin.

Note: See TracTickets for help on using tickets.
Back to Top