Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17054 -- Ensured the test suite runs when gettext isn't availa…

…ble, after r16981.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2bc77be12e2a98ff9e4bc8fe4cf112c17c179403 1 parent 67565a5
Aymeric Augustin authored
7  tests/regressiontests/i18n/commands/tests.py
@@ -2,6 +2,9 @@
2 2
 import re
3 3
 from subprocess import Popen, PIPE
4 4
 
  5
+can_run_extraction_tests = False
  6
+can_run_compilation_tests = False
  7
+
5 8
 def find_command(cmd, path=None, pathext=None):
6 9
     if path is None:
7 10
         path = os.environ.get('PATH', []).split(os.pathsep)
@@ -36,8 +39,8 @@ def find_command(cmd, path=None, pathext=None):
36 39
     if match:
37 40
         xversion = (int(match.group('major')), int(match.group('minor')))
38 41
         if xversion >= (0, 15):
39  
-            from extraction import *
  42
+            can_run_extraction_tests = True
40 43
     del p
41 44
 
42 45
 if find_command('msgfmt'):
43  
-    from compilation import *
  46
+    can_run_compilation_tests = True
13  tests/regressiontests/i18n/tests.py
@@ -22,11 +22,20 @@
22 22
     get_language_info, get_language, get_language_from_request)
23 23
 
24 24
 
25  
-from .commands.tests import NoWrapExtractorTests, IgnoredExtractorTests, MessageCompilationTests, PoFileTests, BasicExtractorTests, JavascriptExtractorTests, CopyPluralFormsExtractorTests, SymlinkExtractorTests, ExtractorTests
  25
+from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
  26
+if can_run_extraction_tests:
  27
+    from .commands.extraction import (ExtractorTests, BasicExtractorTests,
  28
+        JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
  29
+        CopyPluralFormsExtractorTests, NoWrapExtractorTests)
  30
+if can_run_compilation_tests:
  31
+    from .commands.compilation import MessageCompilationTests, PoFileTests
26 32
 from .contenttypes.tests import ContentTypeTests
27 33
 from .forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm
28 34
 from .models import Company, TestModel
29  
-from .patterns.tests import URLRedirectWithoutTrailingSlashTests, URLTranslationTests, URLDisabledTests, URLTagTests, URLTestCaseBase, URLRedirectWithoutTrailingSlashSettingTests, URLNamespaceTests, URLPrefixTests, URLResponseTests, URLRedirectTests
  35
+from .patterns.tests import (URLRedirectWithoutTrailingSlashTests,
  36
+    URLTranslationTests, URLDisabledTests, URLTagTests, URLTestCaseBase,
  37
+    URLRedirectWithoutTrailingSlashSettingTests, URLNamespaceTests,
  38
+    URLPrefixTests, URLResponseTests, URLRedirectTests)
30 39
 from .test_warnings import DeprecationWarningTests
31 40
 
32 41
 

0 notes on commit 2bc77be

Please sign in to comment.
Something went wrong with that request. Please try again.