summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-05-22 18:21:33 +0200
committerClaude Paroz <claude@2xlibre.net>2013-05-22 18:21:33 +0200
commit51998dffe7ef18d314daf23e8e2ef1e2c0891d32 (patch)
treed6d72f3a84631cb23aa0ac7d71c6ed1dbd8b2291 /tests
parentdc51ec8bc214cf60ebb99732363624c23df8005f (diff)
Removed check for 0.15 version of gettext tools
gettext 0.15 has been released in July 2006.
Diffstat (limited to 'tests')
-rw-r--r--tests/i18n/commands/tests.py24
-rw-r--r--tests/i18n/tests.py6
2 files changed, 3 insertions, 27 deletions
diff --git a/tests/i18n/commands/tests.py b/tests/i18n/commands/tests.py
deleted file mode 100644
index f9e3c20fff..0000000000
--- a/tests/i18n/commands/tests.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import os
-import re
-from subprocess import Popen, PIPE
-
-from django.core.management.utils import find_command
-
-can_run_extraction_tests = False
-can_run_compilation_tests = False
-
-# checks if it can find xgettext on the PATH and
-# imports the extraction tests if yes
-xgettext_cmd = find_command('xgettext')
-if xgettext_cmd:
- p = Popen('%s --version' % xgettext_cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True)
- output = p.communicate()[0]
- match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
- if match:
- xversion = (int(match.group('major')), int(match.group('minor')))
- if xversion >= (0, 15):
- can_run_extraction_tests = True
- del p
-
-if find_command('msgfmt'):
- can_run_compilation_tests = True
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 9f1e366c9f..777b9c4f75 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -8,6 +8,7 @@ import pickle
from threading import local
from django.conf import settings
+from django.core.management.utils import find_command
from django.template import Template, Context
from django.template.base import TemplateSyntaxError
from django.test import TestCase, RequestFactory
@@ -33,14 +34,13 @@ from django.utils.translation import (activate, deactivate,
npgettext, npgettext_lazy,
check_for_language)
-from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
-if can_run_extraction_tests:
+if find_command('xgettext'):
from .commands.extraction import (ExtractorTests, BasicExtractorTests,
JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
CopyPluralFormsExtractorTests, NoWrapExtractorTests,
NoLocationExtractorTests, KeepPotFileExtractorTests,
MultipleLocaleExtractionTests)
-if can_run_compilation_tests:
+if find_command('msgfmt'):
from .commands.compilation import (PoFileTests, PoFileContentsTests,
PercentRenderingTests, MultipleLocaleCompilationTests,
CompilationErrorHandling)