1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #24073 -- Deactivated translations when leave_locale_alone is False

Thanks Tim Graham and Markus Holtermann for the reviews.
This commit is contained in:
Claude Paroz
2015-01-03 20:27:18 +01:00
parent 2c0f64b5f6
commit f7c287fca9
4 changed files with 31 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ import os
from django.apps import apps
from django.db import connection
from django.conf import settings
from django.core import management
from django.core.management import BaseCommand, CommandError, find_commands
from django.core.management.utils import find_command, popen_wrapper
@@ -52,7 +53,8 @@ class CommandTests(SimpleTestCase):
out = StringIO()
with translation.override('pl'):
management.call_command('leave_locale_alone_false', stdout=out)
self.assertEqual(out.getvalue(), "en-us\n")
# get_language returns settings.LANGUAGE_CODE for NullTranslations instances
self.assertEqual(out.getvalue(), "%s\n" % settings.LANGUAGE_CODE)
def test_configured_locale_preserved(self):
# Leaves locale from settings when set to false