Merge "django22: Handle changes in management commands"

This commit is contained in:
Zuul 2019-09-10 09:25:08 +00:00 committed by Gerrit Code Review
commit b2614884ee
2 changed files with 30 additions and 11 deletions

View File

@ -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"],
files=[], no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None,
template=None, traceback=False, verbosity=1)
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)

View File

@ -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,8 +30,17 @@ 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',
extensions=["py", "tmpl", "html"],
files=[], no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None,
template=None, traceback=False, verbosity=1)
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,
template=None, traceback=False, verbosity=1)