summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2017-10-13 18:37:31 +0200
committerClaude Paroz <claude@2xlibre.net>2017-10-13 19:52:22 +0200
commit50bbc93ccb9c90a527849cbd18c2f6f02ca83cd1 (patch)
treee31db7b59639b2f2439f45c8455d158069bfba60
parent45b0ec87d3d7c60c60b0f1c69cd89789bafaa6a8 (diff)
[1.11.x] Fixed #28710 -- Fixed the Basque DATE_FORMAT string
Thanks Eneko Illarramendi for the report and initial patch. Backport of 8c538871bda3832bca2dddefe317bf4a9230dd45 from master.
-rw-r--r--django/conf/locale/eu/formats.py2
-rw-r--r--docs/releases/1.11.7.txt2
-rw-r--r--tests/i18n/tests.py18
3 files changed, 21 insertions, 1 deletions
diff --git a/django/conf/locale/eu/formats.py b/django/conf/locale/eu/formats.py
index 4ddf04ef5a..767491719b 100644
--- a/django/conf/locale/eu/formats.py
+++ b/django/conf/locale/eu/formats.py
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
-DATE_FORMAT = r'Yeko M\re\n d\a'
+DATE_FORMAT = r'Y\k\o N j\a'
TIME_FORMAT = 'H:i'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
diff --git a/docs/releases/1.11.7.txt b/docs/releases/1.11.7.txt
index 61f0d6d012..717174c625 100644
--- a/docs/releases/1.11.7.txt
+++ b/docs/releases/1.11.7.txt
@@ -11,3 +11,5 @@ Bugfixes
* Prevented ``cache.get_or_set()`` from caching ``None`` if the ``default``
argument is a callable that returns ``None`` (:ticket:`28601`).
+
+* Fixed the Basque ``DATE_FORMAT`` string (:ticket:`28710`).
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 90141ca5f4..d9224d5319 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -13,6 +13,7 @@ from unittest import skipUnless
from django import forms
from django.conf import settings
+from django.conf.locale import LANG_INFO
from django.conf.urls.i18n import i18n_patterns
from django.template import Context, Template
from django.test import (
@@ -364,6 +365,23 @@ class FormattingTests(SimpleTestCase):
'l': self.long,
})
+ def test_all_format_strings(self):
+ all_locales = LANG_INFO.keys()
+ today = datetime.date.today()
+ now = datetime.datetime.now()
+ current_year = str(today.year)
+ current_day = str(today.day)
+ current_minute = str(now.minute)
+ for locale in all_locales:
+ with translation.override(locale):
+ self.assertIn(current_year, date_format(today)) # Uses DATE_FORMAT by default
+ self.assertIn(current_minute, time_format(now)) # Uses TIME_FORMAT by default
+ self.assertIn(current_year, date_format(now, format=get_format('DATETIME_FORMAT')))
+ self.assertIn(current_year, date_format(today, format=get_format('YEAR_MONTH_FORMAT')))
+ self.assertIn(current_day, date_format(today, format=get_format('MONTH_DAY_FORMAT')))
+ self.assertIn(current_year, date_format(today, format=get_format('SHORT_DATE_FORMAT')))
+ self.assertIn(current_year, date_format(now, format=get_format('SHORT_DATETIME_FORMAT')))
+
def test_locale_independent(self):
"""
Localization of numbers