summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-21 17:26:32 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-21 17:26:32 +0000
commit3ec6568e64d14b6293e7e1b8df0987430ad20905 (patch)
treef28c925f9bf2f671db0ff5656081aca27d26e603 /django/test/utils.py
parent7ca708140a723b42d915d98d9f9c633a77460089 (diff)
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
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index 6edd186b54..51ca37e2f0 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -6,6 +6,7 @@ from django.core.management import call_command
from django.dispatch import dispatcher
from django.test import signals
from django.template import Template
+from django.utils.translation import deactivate
# The prefix to put on the default database name when creating
# the test database.
@@ -43,7 +44,7 @@ def setup_test_environment():
- Installing the instrumented test renderer
- Diverting the email sending functions to a test buffer
-
+ - Setting the active locale to match the LANGUAGE_CODE setting.
"""
Template.original_render = Template.render
Template.render = instrumented_test_render
@@ -53,6 +54,8 @@ def setup_test_environment():
mail.outbox = []
+ deactivate()
+
def teardown_test_environment():
"""Perform any global post-test teardown. This involves: