Hello, I've run on the same problem and now I see that all my custom
templates overrides the default template.
I checked that if I rename my custom project/templates/registration
folder to something else the test runs ok, but if I rename the
template so it doesn't conflicts, it will work fine.

When I print the settings.TEMPLATE_DIRS on AuthViewsTestCase, I see
that it's correctly pointing to auth/templates path, but on any method
of PasswordResetTest, it's pointing to the default templates folder.

When I added the code to set the TEMPLATE_DIRS on PasswordResetTest,
it worked fine, since we're overriding the setup method, and therefore
it will not use the code of the parent class.

So, is it expected, should the django's auth application use the
default project templates and override the urlconf on
PasswordResetTest?


Anderson


On Sep 21, 11:09 am, tom <toab...@googlemail.com> wrote:
> Hi,
>
> i use django-1.1 withdjango.contrib.authand django-registration.
> When i run theunittests, i become anerror. Anybody has an idea?
>
> ./manage.py test auth --settings=develsettings
> /usr/lib/pymodules/python2.6/registration/models.py:4:
> DeprecationWarning: the sha module is deprecated; use the hashlib
> module instead
>   import sha
> Creating test database...
> Creating table django_admin_log
> Creating table auth_permission
> Creating table auth_group
> Creating table auth_user
> Creating table auth_message
> Creating table django_content_type
> Creating table django_session
> Creating table django_site
> Creating table project_project
> Creating table logger_logger
> Creating table sensor_sensor
> Creating table data_originalfile
> Creating table data_entry
> Creating table data_measurand
> Creating table message_loggerwarning
> Creating table registration_registrationprofile
> Installing index for admin.LogEntry model
> Installing index for auth.Permission model
> Installing index for auth.Message model
> Installing index for project.Project model
> Installing index for logger.Logger model
> Installing index for sensor.Sensor model
> Installing index for data.OriginalFile model
> Installing index for data.Entry model
> Installing index for data.Measurand model
> Installing index for message.LoggerWarning model
> ........FFFFFFE...............
> ======================================================================ERROR:Erroris
>  raised if the provided email address isn't currently
> registered
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 52, in test_email_not_found
>     response = self.client.get('/password_reset/')
>   File "/usr/lib/pymodules/python2.6/django/test/client.py", line 281,
> in get
>     response = self.request(**r)
>   File "/usr/lib/pymodules/python2.6/django/test/client.py", line 225,
> in request
>     response = self.handler(environ)
>   File "/usr/lib/pymodules/python2.6/django/test/client.py", line 69,
> in __call__
>     response = self.get_response(request)
>   File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
> line 134, in get_response
>     return self.handle_uncaught_exception(request, resolver, exc_info)
>   File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
> line 166, in handle_uncaught_exception
>     return callback(request, **param_dict)
>   File "/usr/lib/pymodules/python2.6/django/views/defaults.py", line
> 24, in server_error
>     return http.HttpResponseServerError(t.render(Context({})))
>   File "/usr/lib/pymodules/python2.6/django/test/utils.py", line 29,
> in instrumented_test_render
>     return self.nodelist.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/__init__.py",
> line 779, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/pymodules/python2.6/django/template/debug.py", line
> 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py",
> line 97, in render
>     return compiled_parent.render(context)
>   File "/usr/lib/pymodules/python2.6/django/test/utils.py", line 29,
> in instrumented_test_render
>     return self.nodelist.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/__init__.py",
> line 779, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/pymodules/python2.6/django/template/debug.py", line
> 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py",
> line 244, in render
>     return self.nodelist_false.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/__init__.py",
> line 779, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/pymodules/python2.6/django/template/debug.py", line
> 81, in render_node
>     raise wrapped
> TemplateSyntaxError: Caught an exception while rendering: Reverse for
> 'auth_login' with arguments '()' and keyword arguments '{}' not found.
>
> Original Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/template/debug.py", line
> 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py",
> line 382, in render
>     raise e
> NoReverseMatch: Reverse for 'auth_login' with arguments '()' and
> keyword arguments '{}' not found.
>
> ======================================================================
> FAIL: test_confirm_complete
> (django.contrib.auth.tests.views.PasswordResetTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 107, in test_confirm_complete
>     url, path = self._test_confirm_start()
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 70, in _test_confirm_start
>     return self._read_signup_email(mail.outbox[0])
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 74, in _read_signup_email
>     self.assert_(urlmatch is not None, "No URL found in sent email")
> AssertionError: No URL found in sent email
>
> ======================================================================
> FAIL: test_confirm_different_passwords
> (django.contrib.auth.tests.views.PasswordResetTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 122, in test_confirm_different_passwords
>     url, path = self._test_confirm_start()
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 70, in _test_confirm_start
>     return self._read_signup_email(mail.outbox[0])
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 74, in _read_signup_email
>     self.assert_(urlmatch is not None, "No URL found in sent email")
> AssertionError: No URL found in sent email
>
> ======================================================================
> FAIL: test_confirm_invalid
> (django.contrib.auth.tests.views.PasswordResetTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 85, in test_confirm_invalid
>     url, path = self._test_confirm_start()
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 70, in _test_confirm_start
>     return self._read_signup_email(mail.outbox[0])
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 74, in _read_signup_email
>     self.assert_(urlmatch is not None, "No URL found in sent email")
> AssertionError: No URL found in sent email
>
> ======================================================================
> FAIL: test_confirm_invalid_post
> (django.contrib.auth.tests.views.PasswordResetTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 97, in test_confirm_invalid_post
>     url, path = self._test_confirm_start()
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 70, in _test_confirm_start
>     return self._read_signup_email(mail.outbox[0])
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 74, in _read_signup_email
>     self.assert_(urlmatch is not None, "No URL found in sent email")
> AssertionError: No URL found in sent email
>
> ======================================================================
> FAIL: test_confirm_valid
> (django.contrib.auth.tests.views.PasswordResetTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 78, in test_confirm_valid
>     url, path = self._test_confirm_start()
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 70, in _test_confirm_start
>     return self._read_signup_email(mail.outbox[0])
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 74, in _read_signup_email
>     self.assert_(urlmatch is not None, "No URL found in sent email")
> AssertionError: No URL found in sent email
>
> ======================================================================
> FAIL: Email is sent if a valid email address is provided for password
> reset
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/
> views.py", line 63, in test_email_found
>     self.assert_("http://"; in mail.outbox[0].body)
> AssertionError
>
> ----------------------------------------------------------------------
> Ran 30 tests in 109.657s
>
> FAILED (failures=6, errors=1)
> Destroying test database...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to