Re: [Django] #17980: Tests fail when i18n set to True.

2012-07-21 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:  fixed
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 I think this should be fixed now that #18395 has been fixed.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #17980: Tests fail when i18n set to True.

2012-06-02 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 #18395 has a related issue.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-29 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 In [17819]:
 {{{
 #!CommitTicketReference repository="" revision="17819"
 [1.4.X] Make auth test pass even when LANGUAGE_CODE is not 'en'. Refs
 #17980. Thanks wassup for the report.

 Backport of r17811 from trunk.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-28 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by akaariai):

 FWIW the signal patch doesn't look _that_ invasive to me, so I am +0 on
 backpatching it.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-28 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * has_patch:  0 => 1


Comment:

 Interesting case :-) At least, I've now been able to reproduce the issue.
 It depends on other tests doing string translations for a language other
 than 'en' before the auth tests, that's why I couldn't reproduce it.

 So let's assume tests are run before auth tests, and they activate a
 translation ('pl' in our case). Now the cached
 django.utils.translation.trans_real._default global variable is set to
 Polish. Just changing LANGUAGE_CODE in setUp is evidently not sufficient
 to change anything. So let's assume we fix this by calling activate('en')
 after setting LANGUAGE_CODE to 'en' (still in testcase setUp).
 Unfortunately, this is not sufficient, because after self.client.login(),
 the translation will be deactivated again (due to a deactivate() call in
 !LocaleMiddleware.process_response). So when the {{{__proxy__}}} string
 get translated in assertContainsEscaped, the translation engine try the
 _active translation first (now unset), then the _default cached
 translation objects and BANG... the Polish translation is used.

 Now what about solutions?[[BR]]
 I think that the proper way to fix the issue would be to use the
 setting_changed signal to reset the _default cached variable when
 LANGUAGE_CODE is changed, and use override_settings for
 !AuthViewsTestCase.
 However, this might seem too invasive to enter a stable release, so I
 suggest to apply a more simple patch, less clean, but functional that
 could be applied for 1.4.1. And then the more elaborate patch should be
 committed for 1.5. Patches follow.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-28 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 Sorry, but no, the patch is not correct. Using ugettext_lazy is purposely
 allowing some strings to be translated as late as possible to honour the
 current language.

 Well, would you mind sending your application code to me personally
 (claude at 2xlibre dot net), so as I can try to reproduce and debug with
 it?

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-28 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 @claudep: Let me just get the consent of the other members of the team.
 However, I've found a similar bug
 [https://code.djangoproject.com/ticket/17562 #17562]. The same happens
 here, inter alia, with {{{fail_login()}}}.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-28 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 One more thing, don't really know whether it would be relevant. If
 ugettext_lazy is used, it returns {{{__proxy__}}} object. When I loop
 through it, the error message is already translated. Ugettext returns a
 string, the error message is translated as well. Yet, the first one fails
 on assert, while the second one does not. I'm still waiting for the
 response of the other project members and as soon as I get them, I will
 send you the sources.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-27 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 I believe I have found the reason why it is not working for me - the
 problem was in django.contrib.auth.forms. Hence, I provide a tiny patch
 that solved the issue in my case.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-27 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 I do not touch the error_message dicts anywhere in my code. Exactly the
 same version of my project passed the tests well in django 1.3. I just
 have set my project language to 'pl' and operate on ordinary %trans
 'string'% and {{{_('translate this as well')}}} ('_' being
 {{{gettext_lazy}}} or {{{ugettext}}}).

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-27 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 I still cannot figure out how those strings get translated before the
 tests. Do you manipulate these error_message dicts elsewhere in your code?
 And no, I doubt that anything in the development version would fix this.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-27 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 It seems that despite the fact that {{{get_language()}}} returns 'en', the
 string is already translated into Polish in this case. Any hints what it
 might be caused by? I use the stable of version of django 1.4, not the one
 from svn. Shall I possibly try the development version and report back?

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 I fixed the issue about test_unusable_password. Now you should really find
 out why you obtain localized strings in assertContainsEscaped in your
 tests. I cannot reproduce the problem.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 In [17811]:
 {{{
 #!CommitTicketReference repository="" revision="17811"
 Make auth test pass even when LANGUAGE_CODE is not 'en'. Refs #17980.
 Thanks wassup for the report.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 It spits out 'en'. Additionally, I thought it shall be fixed in one place,
 but apparently we're progressing on the bug by bug way. Thus, there are a
 couple of more to go that also fail on an already translated string:

 {{{
 ==
 FAIL: test_password_change_fails_with_invalid_old_password
 (django.contrib.auth.tests.views.ChangePasswordTest)
 --
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-
 packages/django/contrib/auth/tests/views.py", line 209, in
 test_password_change_fails_with_invalid_old_password
 self.assertContainsEscaped(response,
 PasswordChangeForm.error_messages['password_incorrect'])
   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 'Podane stare hasło jest niepoprawne. Proszę
 podać je jeszcze raz.' in response

 ==
 FAIL: test_password_change_fails_with_mismatched_passwords
 (django.contrib.auth.tests.views.ChangePasswordTest)
 --
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-
 packages/django/contrib/auth/tests/views.py", line 219, in
 test_password_change_fails_with_mismatched_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_password_change_succeeds
 (django.contrib.auth.tests.views.ChangePasswordTest)
 --
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-
 packages/django/contrib/auth/tests/views.py", line 230, in
 test_password_change_succeeds
 self.fail_login()
   File "/usr/lib/python2.7/site-
 packages/django/contrib/auth/tests/views.py", line 196, in fail_login
 self.assertContainsEscaped(response,
 AuthenticationForm.error_messages['invalid_login'])
   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 'Proszę wpisać poprawną nazwę użytkownika i
 hasło. Uwaga: wielkość liter ma znaczenie.' in response


 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 OK, now the question is which language is active when the proxy string is
 translated to the real string. It should be 'en' and apparently it is not.
 Could you also debug the current language in the test ({{{from
 django.utils.translation import get_language; print get_language()}}})?

 If it is not 'en', it may be that you are modifying the current language
 somewhere in your code, either in a view or in a middleware.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 Again a formatting problem. I meant:
 {{{
 SetPasswordForm.error_messages['password_mismatch']
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by wassup):

 @jezdez: Sorry - tried to edit it after posting, but it was not possible.
 My fault.

 @claudep: SetPasswordForm.error_messages['password_mismatch'] beffore
 assert is a proxy object: . When I treat it with a loop to get the content, the string is
 already translated to: 'Hasła się nie zgadzają.'

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Old description:

> 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

New description:

 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

Re: [Django] #17980: Tests fail when i18n set to True.

2012-03-26 Thread Django
#17980: Tests fail when i18n set to True.
--+
 Reporter:  wassup|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  tests | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * needs_better_patch:   => 0
 * component:  Testing framework => contrib.auth
 * needs_tests:   => 0
 * keywords:   => tests
 * needs_docs:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 I can confirm the bug in test_unusable_password (the tested string should
 be translated itself).

 However I'm unable to reproduce the !PasswordResetTest errors, as the
 !AuthViewsTestCase parent test case is setting 'en' as default language.
 Could you debug `test_confirm_different_passwords` and check if
 `SetPasswordForm.error_messages['password_mismatch']` is a proxy string
 before the assert statement?

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17980: Tests fail when i18n set to True.

2012-03-25 Thread Django
#17980: Tests fail when i18n set to True.
---+
 Reporter:  wassup |  Owner:  nobody
 Type:  Bug| Status:  new
Component:  Testing framework  |Version:  1.4
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 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

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.