mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user