django22: Handle changes in management commands
The management commands gained a '--force-color' argument in Django 2.2 [1]. [1] https://github.com/django/django/commit/5195b99e2c3 Change-Id: I6729c3c7acbf42af91575eb83908412cf532ffd7 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
d2dc6fa665
commit
493c95459d
@ -14,6 +14,7 @@
|
||||
|
||||
import mock
|
||||
|
||||
import django
|
||||
from django.core.management import call_command
|
||||
from django.core.management import CommandError
|
||||
from django.test import TestCase
|
||||
@ -29,9 +30,17 @@ class CommandsTestCase(TestCase):
|
||||
def test_startdash_usage_correct(self, handle):
|
||||
call_command('startdash', 'test_dash')
|
||||
|
||||
handle.assert_called_with(dash_name='test_dash',
|
||||
extensions=["py", "tmpl", "html", "js",
|
||||
"css"],
|
||||
if django.VERSION >= (2, 2):
|
||||
handle.assert_called_with(
|
||||
dash_name='test_dash',
|
||||
extensions=["py", "tmpl", "html", "js", "css"],
|
||||
files=[], force_color=False, no_color=False, pythonpath=None,
|
||||
settings=None, skip_checks=True, target=None, template=None,
|
||||
traceback=False, verbosity=1)
|
||||
else:
|
||||
handle.assert_called_with(
|
||||
dash_name='test_dash',
|
||||
extensions=["py", "tmpl", "html", "js", "css"],
|
||||
files=[], no_color=False, pythonpath=None,
|
||||
settings=None, skip_checks=True, target=None,
|
||||
template=None, traceback=False, verbosity=1)
|
||||
settings=None, skip_checks=True, target=None, template=None,
|
||||
traceback=False, verbosity=1)
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
import mock
|
||||
|
||||
import django
|
||||
from django.core.management import call_command
|
||||
from django.core.management import CommandError
|
||||
from django.test import TestCase
|
||||
@ -29,7 +30,16 @@ class CommandsTestCase(TestCase):
|
||||
def test_startpanel_usage_correct(self, handle):
|
||||
call_command('startpanel', 'test_dash', '--dashboard=foo.bar')
|
||||
|
||||
handle.assert_called_with(panel_name='test_dash', dashboard='foo.bar',
|
||||
if django.VERSION >= (2, 2):
|
||||
handle.assert_called_with(
|
||||
panel_name='test_dash', dashboard='foo.bar',
|
||||
extensions=["py", "tmpl", "html"],
|
||||
files=[], force_color=False, no_color=False, pythonpath=None,
|
||||
settings=None, skip_checks=True, target=None,
|
||||
template=None, traceback=False, verbosity=1)
|
||||
else:
|
||||
handle.assert_called_with(
|
||||
panel_name='test_dash', dashboard='foo.bar',
|
||||
extensions=["py", "tmpl", "html"],
|
||||
files=[], no_color=False, pythonpath=None,
|
||||
settings=None, skip_checks=True, target=None,
|
||||
|
Loading…
Reference in New Issue
Block a user