summaryrefslogtreecommitdiff
path: root/tests/user_commands/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/user_commands/tests.py')
-rw-r--r--tests/user_commands/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py
index 3900a58247..ae05bcfe25 100644
--- a/tests/user_commands/tests.py
+++ b/tests/user_commands/tests.py
@@ -194,6 +194,18 @@ class CommandTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
management.call_command('dance', unrecognized=1, unrecognized2=1)
+ def test_call_command_with_required_parameters_in_options(self):
+ out = StringIO()
+ management.call_command('required_option', need_me='foo', needme2='bar', stdout=out)
+ self.assertIn('need_me', out.getvalue())
+ self.assertIn('needme2', out.getvalue())
+
+ def test_call_command_with_required_parameters_in_mixed_options(self):
+ out = StringIO()
+ management.call_command('required_option', '--need-me=foo', needme2='bar', stdout=out)
+ self.assertIn('need_me', out.getvalue())
+ self.assertIn('needme2', out.getvalue())
+
class CommandRunTests(AdminScriptTestCase):
"""