Permalink
Browse files

Updated i18n tests a little to handle test failures better and update…

…d Argentinian Spanish format strings. Thanks to Ramiro Morales. Refs #11637.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7e44efb commit b5a4aef43d03c9f8ece64332e165730dd377b033 @jezdez jezdez committed Dec 24, 2009
Showing with 283 additions and 230 deletions.
  1. +25 −14 django/conf/locale/es_AR/formats.py
  2. +13 −0 tests/regressiontests/i18n/forms.py
  3. +245 −216 tests/regressiontests/i18n/tests.py
@@ -2,17 +2,28 @@
# This file is distributed under the same license as the Django package.
#
-# DATE_FORMAT =
-# TIME_FORMAT =
-# DATETIME_FORMAT =
-# YEAR_MONTH_FORMAT =
-# MONTH_DAY_FORMAT =
-# SHORT_DATE_FORMAT =
-# SHORT_DATETIME_FORMAT =
-# FIRST_DAY_OF_WEEK =
-# DATE_INPUT_FORMATS =
-# TIME_INPUT_FORMATS =
-# DATETIME_INPUT_FORMATS =
-# DECIMAL_SEPARATOR =
-# THOUSAND_SEPARATOR =
-# NUMBER_GROUPING =
+DATE_FORMAT = 'j \de F \de Y'
+TIME_FORMAT = 'H:i:s'
+DATETIME_FORMAT = 'j \de F \de Y \a \l\a\s H:i'
+YEAR_MONTH_FORMAT = 'F \de Y'
+MONTH_DAY_FORMAT = 'j \de F'
+SHORT_DATE_FORMAT = 'd/m/Y'
+SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
+FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday
+DATE_INPUT_FORMATS = (
+ '%d/%m/%Y', # '31/12/2009'
+ '%d/%m/%y', # '31/12/09'
+)
+TIME_INPUT_FORMATS = (
+ '%H:%M:%S', # '14:30:59'
+ '%H:%M', # '14:30'
+)
+DATETIME_INPUT_FORMATS = (
+ '%d/%m/%Y %H:%M:%S',
+ '%d/%m/%Y %H:%M',
+ '%d/%m/%y %H:%M:%S',
+ '%d/%m/%y %H:%M',
+)
+DECIMAL_SEPARATOR = ','
+THOUSAND_SEPARATOR = '.'
+NUMBER_GROUPING = 3
@@ -0,0 +1,13 @@
+from django import template, forms
+from django.forms.extras import SelectDateWidget
+
+class I18nForm(forms.Form):
+ decimal_field = forms.DecimalField()
+ float_field = forms.FloatField()
+ date_field = forms.DateField()
+ datetime_field = forms.DateTimeField()
+ time_field = forms.TimeField()
+
+class SelectDateForm(forms.Form):
+ date_field = forms.DateField(widget=SelectDateWidget)
+

0 comments on commit b5a4aef

Please sign in to comment.