﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17980	Tests fail when i18n set to True.	wassup	nobody	"Hi,

When i18n is set to True and project language is not English, some of the default django tests do not pass (it worked fine in 1.3). I believe the reason is that the messages get translated and localized before the tests are run, which results in e.g.:

{{{
======================================================================
FAIL: test_unusable_password (django.contrib.auth.tests.forms.PasswordResetFormTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/usr/lib/python2.7/site-packages/django/contrib/auth/tests/forms.py"", line 336, in test_unusable_password
    [u""The user account associated with this e-mail address cannot reset the password.""])
AssertionError: [u'U\u017cytkownik, kt\xf3rego konto powi\u0105zane jest z tym adresem e-mail nie mo\u017ce zresetowa\u0107 has\u0142a.'] != [u'The user account associated with this e-mail address cannot reset the password.']

======================================================================
FAIL: test_confirm_different_passwords (django.contrib.auth.tests.views.PasswordResetTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/usr/lib/python2.7/site-packages/django/contrib/auth/tests/views.py"", line 184, in test_confirm_different_passwords
    self.assertContainsEscaped(response, SetPasswordForm.error_messages['password_mismatch'])
  File ""/usr/lib/python2.7/site-packages/django/contrib/auth/tests/views.py"", line 54, in assertContainsEscaped
    return self.assertContains(response, escape(force_unicode(text)), **kwargs)
  File ""/usr/lib/python2.7/site-packages/django/test/testcases.py"", line 637, in assertContains
    msg_prefix + ""Couldn't find '%s' in response"" % text)
AssertionError: Couldn't find 'Hasła się nie zgadzają.' in response

======================================================================
FAIL: test_email_not_found (django.contrib.auth.tests.views.PasswordResetTest)
Error is raised if the provided email address isn't currently registered
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/usr/lib/python2.7/site-packages/django/contrib/auth/tests/views.py"", line 91, in test_email_not_found
    self.assertContainsEscaped(response, PasswordResetForm.error_messages['unknown'])
  File ""/usr/lib/python2.7/site-packages/django/contrib/auth/tests/views.py"", line 54, in assertContainsEscaped
    return self.assertContains(response, escape(force_unicode(text)), **kwargs)
  File ""/usr/lib/python2.7/site-packages/django/test/testcases.py"", line 637, in assertContains
    msg_prefix + ""Couldn't find '%s' in response"" % text)
AssertionError: Couldn't find 'Ten adres e-mail nie ma przypisanego konta. Jesteś pewien, że zarejestrowałeś się?' in response

----------------------------------------------------------------------
}}}

I believe the default django tests should not be run against the localized strings or am I missing something?

Regards,

wassup"	Bug	closed	contrib.auth	1.4	Normal	fixed	tests		Accepted	1	0	0	0	0	0
