Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16517 closed Bug (duplicate)

Django tests fail if project LOGIN_URL setting doesn't end with '/login/'

Reported by: Bjorn Kristinsson Owned by: nobody
Component: contrib.auth Version: 1.3
Severity: Normal Keywords:
Cc: bjornkri@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

To reproduce:

Start a new project, edit settings.py and add:

...
LOGIN_URL = '/foobar/'
...
        'ENGINE': 'django.db.backends.sqlite3',

(Adding sqlite3 to the database engine setting so the tests will run)

Running ./manage.py test will now fail.

The culprit is in test_password_change_done_fails() in /django/contrib/auth/tests/views.py:

self.assertTrue(response['Location'].endswith('/login/?next=/password_change/done/'))

Patch attached that replaces his line with

self.assertTrue(response['Location'].endswith('/?next=/password_change/done/'))

Attachments (1)

test_password_change_done_fails.diff (628 bytes ) - added by Bjorn Kristinsson 13 years ago.

Download all attachments as: .zip

Change History (4)

by Bjorn Kristinsson, 13 years ago

comment:1 by Bjorn Kristinsson, 13 years ago

Cc: bjornkri@… added

comment:2 by Aymeric Augustin, 13 years ago

Resolution: duplicate
Status: newclosed

This was reported in #16413 — which is the first search result for "LOGIN_URL" :)

comment:3 by Bjorn Kristinsson, 13 years ago

Ah. At least now we have a result for "test_password_change_done_fails" which is what I went looking for ;)

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