#7611: auth app PasswordResetTest requires admin app to be installed
---------------------------------------+------------------------------------
Reporter: andrewbadr | Owner: jason
Status: closed | Milestone: 1.0
Component: Unit test system | Version: SVN
Resolution: wontfix | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------+------------------------------------
Changes (by russellm):
* status: assigned => closed
* resolution: => wontfix
Comment:
I've provided a slightly patch updated to post-newforms-admin merge, with
a slightly modified approach - the implementation of the template loader
convinced me that a dictionary syntax probably isn't the right thing to do
here, and munging TEMPLATE_DIRS to be a dictionary could have all sorts of
consequences.
However, after working on this patch and thinking about it a bit more, I'm
not convinced that this is the right thing to do. I'm now of the opinion
that the reported problem is in fact a correct test failure.
In the reported circumstances (auth deployed, but not admin), the auth
test is failing because certain templates are not found.
When auth is tested as part of the Django system tests, admin is also
deployed, so the templates are found.
The tests would pass for the reporter if the user provided a
'registration/password_reset_form.html' template in their own project.
If the reporter _had_ deployed contrib.admin, but _didn't_ use the
app_directories template loader, the tests would have failed, because the
ability to load the admin templates is dependent on the use of the
app_directories template loader.
Essentially, as currently defined, the auth tests are validating that the
auth application will work _in your current project_. If you're not
providing a way to load a template called
'registration/password_reset_form.html', then the auth views will fail in
your project, and the failure is correctly reported. It doesn't matter if
you are providing that template yourself, or if it is loaded from admin,
but it must be provided.
This test also serves as a check that when a template that _is_ provided,
it is correct - in this case, that it renders the form, and displays the
right error message. It's not enough that you have a template - you have
to have a meaningful template, too. You don't have to use the admin
password_reset_form.html template, but whatever you use, it has to render
the form, and display the errors on the email field.
This does raise the slight problem that the 'missing' templates are
required, even if you aren't using the auth views in your project.
However, I feel that this is probably an edge case that we can live with.
If anyone disagrees with this analysis, feel free to raise it on django-
dev, but for the moment, I'm closing wontfix. Apologies to Jason who
worked on this ticket after my initial advice. Hopefully you gained some
experience with the test and template systems, even if that experience
isn't going to be put to use for the moment.
--
Ticket URL: <http://code.djangoproject.com/ticket/7611#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---