1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #17628 -- Extended makemessages command to also ignore directories when walking, not only when looking for files. Thanks, Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2012-02-04 18:27:24 +00:00
parent 62dc16dcd8
commit c6065545ef
2 changed files with 48 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import with_statement
import os
import re
import shutil
from StringIO import StringIO
from django.core import management
from django.test import TestCase
@@ -177,7 +178,11 @@ class IgnoredExtractorTests(ExtractorTests):
def test_ignore_option(self):
os.chdir(self.test_dir)
pattern1 = os.path.join('ignore_dir', '*')
management.call_command('makemessages', locale=LOCALE, verbosity=0, ignore_patterns=[pattern1])
stdout = StringIO()
management.call_command('makemessages', locale=LOCALE, verbosity=2,
ignore_patterns=[pattern1], stdout=stdout)
data = stdout.getvalue()
self.assertTrue("ignoring directory ignore_dir" in data)
self.assertTrue(os.path.exists(self.PO_FILE))
with open(self.PO_FILE, 'r') as fp:
po_contents = fp.read()