#10521 closed (fixed)
Test failure of missing url '/' in test django.contrib.auth.tests.remote_user.py
Reported by: | Kegan Gan | Owned by: | Ramiro Morales |
---|---|---|---|
Component: | contrib.auth | Version: | |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Running tests for django.contrib.auth (>python manage test auth) failed with "TemplateDoesNotExist: 404.html" errors.
Tested in trunk revision 10069.
File django/contrib/auth/tests/remote_users.py were added in trunk revision 10063.
Attachments (3)
Change History (14)
follow-ups: 2 10 comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I included django.contrib.auth in INSTALLED_APPS (settings.py of my project). When I run "./manage test", it inevitably run django.contrib.auth testcases (and testcases for all the other installed apps). This have been fine for all django.contrib apps ... since prior 1.0. Now, I get errors for django.contrib.auth.
Should I never run "./manage test" by itself, and must always specify app explicity?
Replying to ramiro:
You aren't supposed to run Django test suite tests using
manage.py
Closing as invalid because running
tests/runtests.py auth --verbosity=2
with an appropiate settings file shows the tests added in r10069 are run and don't generate error.
by , 16 years ago
Attachment: | 10521-remote-user-tests-enh.diff added |
---|
Patch that allows django.contrib.auth tests to run w/o errors from a project when using manage.py and the auth app is in INSTALLED_APPS
comment:3 by , 16 years ago
Has patch: | set |
---|
The attached patch implements changes to the new tests so they run successfully not only as part of the Django test suite but also when the auth app is in INSTALLED_APPS
and manage.py test
is used in a project.
Something the patch can't express (but could be implemented with a svn mv
instead) is that the django/contrib/auth/tests/views.py
gets renamed to django/contrib/auth/tests/views_tests.py
.
comment:4 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
The current test also fails when the '/' view in the project uses inherited templates, causing response.context to be a list which leads to a 'TypeError: list indices must be integers' error.
The approach in ramiro's patch seems like the right way to go here.
by , 16 years ago
Attachment: | 10112-remote_users_test.diff added |
---|
Propose new patch. Include mock urls and views into test file.
comment:5 by , 16 years ago
Propose new patch 10112-remote_users_test.diff.
This patch does not affect django/contrib/auth/tests/views.py
, as compare to the previous patch.
comment:6 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:7 by , 16 years ago
Kegan's patch also fixes the case where the root URL of a project redirects, or if it doesn't exist at all.
comment:8 by , 16 years ago
milestone: | → 1.1 |
---|
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 by , 16 years ago
Replying to ramiro:
You aren't supposed to run Django test suite tests using
manage.py
Closing as invalid because running
tests/runtests.py auth --verbosity=2
with an appropiate settings file shows the tests added in r10069 are run and don't generate error.
I quoth the documentation:
Running tests
Once you've written tests, run them using your project's manage.py utility:
$ ./manage.py test
So, do we run tests in this manner or not?
You aren't supposed to run Django test suite tests using
manage.py
Closing as invalid because running
tests/runtests.py auth --verbosity=2
with an appropiate settings file shows the tests added in r10069 are run and don't generate error.