diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-02-04 14:35:52 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2018-05-13 10:21:53 +0200 |
| commit | d65b0f72de8d35617fe0554ddabc950c7f323eef (patch) | |
| tree | 856b84e4b4200a89042ddbdd074c3015d0eda0f1 /tests/user_commands/tests.py | |
| parent | 1e0cbc72e5bcb1c1e235b3cd82a92800ed3c84b8 (diff) | |
Fixed #17379 -- Removed management commands deactivation of the locale.
Diffstat (limited to 'tests/user_commands/tests.py')
| -rw-r--r-- | tests/user_commands/tests.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 61e649c75a..b5d29721b4 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -63,17 +63,16 @@ class CommandTests(SimpleTestCase): dance.Command.requires_system_checks = True self.assertIn("CommandError", stderr.getvalue()) - def test_deactivate_locale_set(self): - # Deactivate translation when set to true + def test_no_translations_deactivate_translations(self): + """ + When the Command handle method is decorated with @no_translations, + translations are deactivated inside the command. + """ + current_locale = translation.get_language() with translation.override('pl'): - result = management.call_command('leave_locale_alone_false', stdout=StringIO()) + result = management.call_command('no_translations', stdout=StringIO()) self.assertIsNone(result) - - def test_configured_locale_preserved(self): - # Leaves locale from settings when set to false - with translation.override('pl'): - result = management.call_command('leave_locale_alone_true', stdout=StringIO()) - self.assertEqual(result, "pl") + self.assertEqual(translation.get_language(), current_locale) def test_find_command_without_PATH(self): """ |
