Skip to content

Commit

Permalink
Fixed #17054 -- Ensured the test suite runs when gettext isn't availa…
Browse files Browse the repository at this point in the history
…ble, after r16981.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
aaugustin committed Oct 18, 2011
1 parent 67565a5 commit 2bc77be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/regressiontests/i18n/commands/tests.py
Expand Up @@ -2,6 +2,9 @@
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)
Expand Down Expand Up @@ -36,8 +39,8 @@ def find_command(cmd, path=None, pathext=None):
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
13 changes: 11 additions & 2 deletions tests/regressiontests/i18n/tests.py
Expand Up @@ -22,11 +22,20 @@
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


Expand Down

0 comments on commit 2bc77be

Please sign in to comment.