mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Made (make|compile)messages check for availability of gettext commands.
Refs #19584.
This commit is contained in:
parent
3f43f5f3b0
commit
7fca4416c7
6 changed files with 137 additions and 70 deletions
|
@ -1,13 +1,14 @@
|
|||
import sys
|
||||
|
||||
from django.core import management
|
||||
from django.core.management.base import CommandError
|
||||
from django.test import TestCase
|
||||
from django.core.management import CommandError
|
||||
from django.core.management.utils import popen_wrapper
|
||||
from django.test import SimpleTestCase
|
||||
from django.utils import translation
|
||||
from django.utils.six import StringIO
|
||||
|
||||
|
||||
class CommandTests(TestCase):
|
||||
class CommandTests(SimpleTestCase):
|
||||
def test_command(self):
|
||||
out = StringIO()
|
||||
management.call_command('dance', stdout=out)
|
||||
|
@ -58,3 +59,9 @@ class CommandTests(TestCase):
|
|||
with translation.override('pl'):
|
||||
management.call_command('leave_locale_alone_true', stdout=out)
|
||||
self.assertEqual(out.getvalue(), "pl\n")
|
||||
|
||||
|
||||
class UtilsTests(SimpleTestCase):
|
||||
|
||||
def test_no_existent_external_program(self):
|
||||
self.assertRaises(CommandError, popen_wrapper, ['a_42_command_that_doesnt_exist_42'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue