Modified a couple of i18n regression tests to make them run under Windows.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16281 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
723b620c7e
commit
c3db0b058c
|
@ -82,7 +82,10 @@ class BasicExtractorTests(ExtractorTests):
|
||||||
try:
|
try:
|
||||||
management.call_command('makemessages', locale=LOCALE, verbosity=0)
|
management.call_command('makemessages', locale=LOCALE, verbosity=0)
|
||||||
except SyntaxError, e:
|
except SyntaxError, e:
|
||||||
self.assertEqual(str(e), 'Translation blocks must not include other block tags: blocktrans (file templates/template_with_error.html, line 3)')
|
self.assertRegexpMatches(
|
||||||
|
str(e),
|
||||||
|
r'Translation blocks must not include other block tags: blocktrans \(file templates[/\\]template_with_error\.html, line 3\)'
|
||||||
|
)
|
||||||
finally:
|
finally:
|
||||||
os.remove('./templates/template_with_error.html')
|
os.remove('./templates/template_with_error.html')
|
||||||
os.remove('./templates/template_with_error.html.py') # Waiting for #8536 to be fixed
|
os.remove('./templates/template_with_error.html.py') # Waiting for #8536 to be fixed
|
||||||
|
@ -105,7 +108,8 @@ class IgnoredExtractorTests(ExtractorTests):
|
||||||
|
|
||||||
def test_ignore_option(self):
|
def test_ignore_option(self):
|
||||||
os.chdir(self.test_dir)
|
os.chdir(self.test_dir)
|
||||||
management.call_command('makemessages', locale=LOCALE, verbosity=0, ignore_patterns=['ignore_dir/*'])
|
pattern1 = os.path.join('ignore_dir', '*')
|
||||||
|
management.call_command('makemessages', locale=LOCALE, verbosity=0, ignore_patterns=[pattern1])
|
||||||
self.assertTrue(os.path.exists(self.PO_FILE))
|
self.assertTrue(os.path.exists(self.PO_FILE))
|
||||||
po_contents = open(self.PO_FILE, 'r').read()
|
po_contents = open(self.PO_FILE, 'r').read()
|
||||||
self.assertMsgId('This literal should be included.', po_contents)
|
self.assertMsgId('This literal should be included.', po_contents)
|
||||||
|
|
Loading…
Reference in New Issue