diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-02-16 12:15:41 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-02-16 12:15:41 +0000 |
| commit | 89df0432f21909b25b690dc5ebe479a025a62bd0 (patch) | |
| tree | 7c6ab4f0a49742fda4664710a11cad494fee135a /tests | |
| parent | eb26c9686bc1f9b9b5bcd10e861fc7d055845209 (diff) | |
Fixed #6505 - Copy plural forms from Django translation files for newly created translation files. Thanks to Ramiro Morales for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12445 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/makemessages/tests.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/regressiontests/makemessages/tests.py b/tests/regressiontests/makemessages/tests.py index 4be31a717b..4b4fa1b07e 100644 --- a/tests/regressiontests/makemessages/tests.py +++ b/tests/regressiontests/makemessages/tests.py @@ -8,6 +8,8 @@ LOCALE='de' class ExtractorTests(TestCase): + PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE + def setUp(self): self._cwd = os.getcwd() self.test_dir = os.path.abspath(os.path.dirname(__file__)) @@ -47,8 +49,6 @@ class JavascriptExtractorTests(ExtractorTests): class IgnoredExtractorTests(ExtractorTests): - PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE - def test_ignore_option(self): os.chdir(self.test_dir) management.call_command('makemessages', locale=LOCALE, verbosity=0, ignore_patterns=['ignore_dir/*']) @@ -60,8 +60,6 @@ class IgnoredExtractorTests(ExtractorTests): class SymlinkExtractorTests(ExtractorTests): - PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE - def setUp(self): self._cwd = os.getcwd() self.test_dir = os.path.abspath(os.path.dirname(__file__)) @@ -88,3 +86,13 @@ class SymlinkExtractorTests(ExtractorTests): po_contents = open(self.PO_FILE, 'r').read() self.assertMsgId('This literal should be included.', po_contents) self.assert_('templates_symlinked/test.html' in po_contents) + + +class CopyPluralFormsExtractorTests(ExtractorTests): + + def test_copy_plural_forms(self): + os.chdir(self.test_dir) + management.call_command('makemessages', locale=LOCALE, verbosity=0) + self.assert_(os.path.exists(self.PO_FILE)) + po_contents = open(self.PO_FILE, 'r').read() + self.assert_('Plural-Forms: nplurals=2; plural=(n != 1)' in po_contents) |
