summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-11-07 11:28:31 +0000
committerRamiro Morales <cramm0@gmail.com>2011-11-07 11:28:31 +0000
commite92b3b723f9bf953d0465e92e444045cdc837042 (patch)
tree450b57e743832f0c575c268682b0d0a5f214138a /tests
parent90d369741727dbf0cf1c94b23fb2340c7edb8b02 (diff)
Fixed #11118 -- Made management command BaseCommand restore locale after execution.
Thanks rvdrijst for the report and initial patch and Claude Paroz for enhancing it. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17077 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/user_commands/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/modeltests/user_commands/tests.py b/tests/modeltests/user_commands/tests.py
index bf74a98440..896dd667ff 100644
--- a/tests/modeltests/user_commands/tests.py
+++ b/tests/modeltests/user_commands/tests.py
@@ -3,6 +3,7 @@ from StringIO import StringIO
from django.core import management
from django.core.management.base import CommandError
from django.test import TestCase
+from django.utils import translation
class CommandTests(TestCase):
@@ -18,5 +19,11 @@ class CommandTests(TestCase):
self.assertEqual(out.getvalue(),
"I don't feel like dancing Jive.")
+ def test_language_preserved(self):
+ out = StringIO()
+ with translation.override('fr'):
+ management.call_command('dance', stdout=out)
+ self.assertEqual(translation.get_language(), 'fr')
+
def test_explode(self):
- self.assertRaises(CommandError, management.call_command, ('explode',)) \ No newline at end of file
+ self.assertRaises(CommandError, management.call_command, ('explode',))