1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed clash caused by the newly introduced -e shorthand for makemessages --exclude.

This fixes a regression caused by 0707b82. Refs #22328.
This commit is contained in:
Loic Bistuer
2014-05-01 14:03:24 +07:00
parent 0dce44e16b
commit d1799233f4
6 changed files with 35 additions and 10 deletions

View File

@@ -5,12 +5,14 @@ import io
import os
import re
import shutil
import sys
import time
from unittest import SkipTest, skipUnless
import warnings
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from django.core.management.utils import find_command
from django.test import SimpleTestCase
from django.test import override_settings
@@ -565,6 +567,17 @@ class ExcludedLocaleExtractionTests(ExtractorTests):
self._set_times_for_all_po_files()
self.addCleanup(self._rmrf, os.path.join(self.test_dir, 'locale'))
def test_command_help(self):
old_stdout, old_stderr = sys.stdout, sys.stderr
sys.stdout, sys.stderr = StringIO(), StringIO()
try:
# `call_command` bypasses the parser; by calling
# `execute_from_command_line` with the help subcommand we
# ensure that there are no issues with the parser itself.
execute_from_command_line(['django-admin', 'help', 'makemessages'])
finally:
sys.stdout, sys.stderr = old_stdout, old_stderr
def test_one_locale_excluded(self):
management.call_command('makemessages', exclude=['it'], stdout=StringIO())
self.assertRecentlyModified(self.PO_FILE % 'en')