Opened 16 years ago

Closed 15 years ago

Last modified 13 years ago

#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)

10521-remote-user-tests-enh.diff (18.9 KB ) - added by Ramiro Morales 16 years ago.
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
10112-remote_users_test.diff (1.1 KB ) - added by Kegan Gan 16 years ago.
Propose new patch. Include mock urls and views into test file.
handlers.diff (471 bytes ) - added by fractal 15 years ago.
adding handlers to import

Download all attachments as: .zip

Change History (14)

comment:1 by Ramiro Morales, 16 years ago

Resolution: invalid
Status: newclosed

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.

in reply to:  1 comment:2 by Kegan Gan, 16 years ago

Resolution: invalid
Status: closedreopened

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 Ramiro Morales, 16 years ago

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 Ramiro Morales, 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 Koen Biermans <koen.biermans@…>, 16 years ago

Triage Stage: UnreviewedAccepted

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 Kegan Gan, 16 years ago

Propose new patch. Include mock urls and views into test file.

comment:5 by Kegan Gan, 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 Ramiro Morales, 16 years ago

Owner: changed from nobody to Ramiro Morales
Status: reopenednew

comment:7 by George Song, 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 Russell Keith-Magee, 15 years ago

milestone: 1.1

comment:9 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [10674]) Fixed #10521 -- Modified the Remote User tests so that it isn't dependent on particular deployed URLs. Thanks to Kegan and Ramiro Morales for their contributions.

by fractal, 15 years ago

Attachment: handlers.diff added

adding handlers to import

in reply to:  1 comment:10 by matt@…, 15 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?

comment:11 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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