Hello list. I have a question. I've never done unit testing with Django before. I still don't write any unittest but when I do this:
sudo. / manage.py test Many errors appears. Errors related with the authentication. Errors like: ====================================================================== FAIL: test_confirm_invalid (django.contrib.auth.tests.views.PasswordResetTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/views.py", line 76, in test_confirm_invalid url, path = self._test_confirm_start() File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/views.py", line 60, in _test_confirm_start self.assertEquals(len(mail.outbox), 1) AssertionError: 0 != 1 ====================================================================== FAIL: test_confirm_invalid_post (django.contrib.auth.tests.views.PasswordResetTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/views.py", line 88, in test_confirm_invalid_post url, path = self._test_confirm_start() File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/views.py", line 60, in _test_confirm_start self.assertEquals(len(mail.outbox), 1) AssertionError: 0 != 1 ====================================================================== FAIL: test_confirm_valid (django.contrib.auth.tests.views.PasswordResetTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/views.py", line 69, in test_confirm_valid url, path = self._test_confirm_start() File "/usr/local/lib/python2.6/dist-packages/djan ...... ====================================================================== ERROR: test_last_login (django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ tests/remote_user.py", line 87, in test_last_login self.assertNotEqual(default_login, response.context['user'].last_login) TypeError: 'NoneType' object is unsubscriptable ================================================== Some idea?. Another question. My database use something of sql . Normally when I build the empty database, I insert this query : 'Create language plpgsql'. After I do :python manage.py syncdb. But in a test a new database is automatically created. How can I run a test over an empty database but already created. Thanks for read and sorry for my poor english. -- 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.