Re: [Django] #17194: Auth tests failing on non-US locales

2011-12-15 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by jezdez):

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


Comment:

 In [17204]:
 {{{
 #!CommitTicketReference repository="" revision="17204"
 Fixed #17194 -- Made sure the auth form tests work if a language other
 than English is activated by moving the error message translation strings
 into class level dictionaries. Many thanks to Claude Paroz, rabio and Bas
 Peschier for their initial work on 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] #17194: Auth tests failing on non-US locales

2011-12-10 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by bpeschier):

 If you go that approach, it might be a good idea to actually place the
 error messages on the relevant forms and fields so you can reuse them in
 the tests.

 It's also better to reuse the html-escape from django (in
 django.utils.html) instead of creating a new one.

 Attached a patch.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-17 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by rabio):

 Let me propose another approach. Instead of setting fixed locale for auth
 tests, use localized strings in tests instead. Patch attached below does
 exactly that.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-17 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by claudep):

 With @override_settings and self.settings(), the logic is "Current
 settings except this one and this one". You never really no if suddenly a
 new different setting has a new side effect.

 With this class, the logic is reversed. Default settings are the base
 (sort of a sandbox), and you only specify the particular settings (if any)
 which you want to specifically test.

 There are pros and cons, as usual. The DefaultSettingsTestCase approach
 does address the specific issue of being able to test with a known and
 stable set of settings. Whether it is wanted or not, that's a design
 decision.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-17 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by jezdez):

 Hm, I'm not sure why another test case class is needed, mind elaborating?
 I always thought `@override_settings` and `self.settings()` would be
 enough, isolating test classes has worked elsewhere, so why shouldn't it
 here?

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-13 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by claudep):

 Replying to [comment:5 hcarvalhoalves]:
 > The patch only overrides the locale for Django's own tests, correct?
 User-provided tests will still run on the settings.py locale?

 Yes, of course.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-13 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by hcarvalhoalves):

 The patch only overrides the locale for Django's own tests, correct? User-
 provided tests will still run on the settings.py locale?

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-11 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by claudep):

 Note also that the latest patch might also fix #13394 and #16366. (see
 also #9156)

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-11 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by claudep):

 After discussion with Julien on irc, I've come with a radically different
 approach, with a new DefaultSettingsTestCase class that strives to
 completely isolate the contrib.auth tests from custom project settings.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-11 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by claudep):

 * has_patch:  0 => 1


Comment:

 Here's my proposal to fix it. Just setting LANGUAGE_CODE isn't sufficient
 to change current language, that's why I changed override_settings to
 special-case LANGUAGE_CODE setting change. Might be useful in other tests,
 too.

 The other solution would be to enclose each string comparison test with
 translation.override, but it seems not very DRY to me.

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-10 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  SVN
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by julien):

 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 That's right, multiple tests are failing when the project's
 `settings.LANGUAGE_CODE` isn't English. Those tests need to be made more
 isolated by temporarily overring the locale. Would you like to provide a
 patch?

-- 
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] #17194: Auth tests failing on non-US locales

2011-11-10 Thread Django
#17194: Auth tests failing on non-US locales
+
 Reporter:  hcarvalhoalves  |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  contrib.auth|Version:  SVN
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  1   |  UI/UX:  0
+
 Auth tests are failing on current trunk (1.4). An error message is being
 compared as a test condition, but this fails since the error message will
 return a translated string (in this particular case, pt_br).

 {{{
 Destroying old test database 'default'...
 ..F
 ==
 FAIL: test_inactive_user
 (django.contrib.auth.tests.forms.AuthenticationFormTest)
 --
 Traceback (most recent call last):
   File
 
"/Users/hcalves/.virtualenvs/omelete.v2/src/django/django/contrib/auth/tests/forms.py",
 line 105, in test_inactive_user
 [u'This account is inactive.'])
 AssertionError: [u'Esta conta est\xe1 inativa.'] != [u'This account is
 inactive.']

 }}}

-- 
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.