1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Modified the test harness to respect the LANGUAGE_CODE setting. Also changed

Django's own test runner to always use 'en' for LANGUAGE_CODE when testing
core. Fixed #4709


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-10-21 17:26:32 +00:00
parent 7ca708140a
commit 3ec6568e64
2 changed files with 7 additions and 1 deletions

View File

@@ -93,6 +93,7 @@ def django_tests(verbosity, interactive, test_labels):
old_root_urlconf = settings.ROOT_URLCONF
old_template_dirs = settings.TEMPLATE_DIRS
old_use_i18n = settings.USE_I18N
old_language_code = settings.LANGUAGE_CODE
old_middleware_classes = settings.MIDDLEWARE_CLASSES
# Redirect some settings for the duration of these tests.
@@ -100,6 +101,7 @@ def django_tests(verbosity, interactive, test_labels):
settings.ROOT_URLCONF = 'urls'
settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), TEST_TEMPLATE_DIR),)
settings.USE_I18N = True
settings.LANGUAGE_CODE = 'en'
settings.MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -151,6 +153,7 @@ def django_tests(verbosity, interactive, test_labels):
settings.ROOT_URLCONF = old_root_urlconf
settings.TEMPLATE_DIRS = old_template_dirs
settings.USE_I18N = old_use_i18n
settings.LANGUAGE_CODE = old_language_code
settings.MIDDLEWARE_CLASSES = old_middleware_classes
if __name__ == "__main__":