diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils_tests/locale/nl/LC_MESSAGES/django.mo | bin | 0 -> 367 bytes | |||
| -rw-r--r-- | tests/utils_tests/locale/nl/LC_MESSAGES/django.po | 17 | ||||
| -rw-r--r-- | tests/utils_tests/test_autoreload.py | 37 |
3 files changed, 54 insertions, 0 deletions
diff --git a/tests/utils_tests/locale/nl/LC_MESSAGES/django.mo b/tests/utils_tests/locale/nl/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 0000000000..3ead8f2a31 --- /dev/null +++ b/tests/utils_tests/locale/nl/LC_MESSAGES/django.mo diff --git a/tests/utils_tests/locale/nl/LC_MESSAGES/django.po b/tests/utils_tests/locale/nl/LC_MESSAGES/django.po new file mode 100644 index 0000000000..6633f12b39 --- /dev/null +++ b/tests/utils_tests/locale/nl/LC_MESSAGES/django.po @@ -0,0 +1,17 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-15 19:15+0200\n" +"PO-Revision-Date: 2010-05-12 12:41-0300\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py new file mode 100644 index 0000000000..3843ecafb4 --- /dev/null +++ b/tests/utils_tests/test_autoreload.py @@ -0,0 +1,37 @@ +import os + +from django import conf +from django.test import TestCase, override_settings +from django.utils.autoreload import gen_filenames + +LOCALE_PATH = os.path.join(os.path.dirname(__file__), 'locale') + + +class TestFilenameGenerator(TestCase): + def test_django_locales(self): + """ + Test that gen_filenames() also yields the built-in django locale files. + """ + filenames = list(gen_filenames()) + locales = [] + + basedir = os.path.join(os.path.dirname(conf.__file__), 'locale') + for dirpath, dirnames, locale_filenames in os.walk(basedir): + for filename in locale_filenames: + if filename.endswith('.mo'): + locales.append(os.path.join(dirpath, filename)) + + self.assertTrue(len(locales) > 10) # assume a few available locales + for filename in locales: + self.assertIn(filename, filenames) + + @override_settings( + LOCALE_PATHS=(LOCALE_PATH,) + ) + def test_app_locales(self): + """ + Test that gen_filenames also yields from LOCALE_PATHS. + """ + filenames = list(gen_filenames()) + self.assertIn(os.path.join(LOCALE_PATH, 'nl', 'LC_MESSAGES', 'django.mo'), + filenames) |
