summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/i18n/commands/tests.py7
-rw-r--r--tests/regressiontests/i18n/tests.py13
2 files changed, 16 insertions, 4 deletions
diff --git a/tests/regressiontests/i18n/commands/tests.py b/tests/regressiontests/i18n/commands/tests.py
index c3be2178e4..38e8af1d0d 100644
--- a/tests/regressiontests/i18n/commands/tests.py
+++ b/tests/regressiontests/i18n/commands/tests.py
@@ -2,6 +2,9 @@ import os
import re
from subprocess import Popen, PIPE
+can_run_extraction_tests = False
+can_run_compilation_tests = False
+
def find_command(cmd, path=None, pathext=None):
if path is None:
path = os.environ.get('PATH', []).split(os.pathsep)
@@ -36,8 +39,8 @@ if xgettext_cmd:
if match:
xversion = (int(match.group('major')), int(match.group('minor')))
if xversion >= (0, 15):
- from extraction import *
+ can_run_extraction_tests = True
del p
if find_command('msgfmt'):
- from compilation import *
+ can_run_compilation_tests = True
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index fc69d9cc59..17a96ed433 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -22,11 +22,20 @@ from django.utils.translation import (ugettext, ugettext_lazy, activate,
get_language_info, get_language, get_language_from_request)
-from .commands.tests import NoWrapExtractorTests, IgnoredExtractorTests, MessageCompilationTests, PoFileTests, BasicExtractorTests, JavascriptExtractorTests, CopyPluralFormsExtractorTests, SymlinkExtractorTests, ExtractorTests
+from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
+if can_run_extraction_tests:
+ from .commands.extraction import (ExtractorTests, BasicExtractorTests,
+ JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
+ CopyPluralFormsExtractorTests, NoWrapExtractorTests)
+if can_run_compilation_tests:
+ from .commands.compilation import MessageCompilationTests, PoFileTests
from .contenttypes.tests import ContentTypeTests
from .forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm
from .models import Company, TestModel
-from .patterns.tests import URLRedirectWithoutTrailingSlashTests, URLTranslationTests, URLDisabledTests, URLTagTests, URLTestCaseBase, URLRedirectWithoutTrailingSlashSettingTests, URLNamespaceTests, URLPrefixTests, URLResponseTests, URLRedirectTests
+from .patterns.tests import (URLRedirectWithoutTrailingSlashTests,
+ URLTranslationTests, URLDisabledTests, URLTagTests, URLTestCaseBase,
+ URLRedirectWithoutTrailingSlashSettingTests, URLNamespaceTests,
+ URLPrefixTests, URLResponseTests, URLRedirectTests)
from .test_warnings import DeprecationWarningTests