summaryrefslogtreecommitdiff
path: root/tests/user_commands/management
diff options
context:
space:
mode:
authorAlex Tomic <atomic777@gmail.com>2018-03-02 12:25:08 -0500
committerTim Graham <timograham@gmail.com>2018-03-02 12:25:08 -0500
commita1a3e515616da102fc48a1e1af8a5b2f429f747e (patch)
tree9b4d8d0fc4de50f09aa6be39a4ed00842a5ce2bb /tests/user_commands/management
parent40bac28faabbacd0875e59455cd80fb1dbb16966 (diff)
Fixed #29133 -- Fixed call_command() crash if a required option is passed in options.
Diffstat (limited to 'tests/user_commands/management')
-rw-r--r--tests/user_commands/management/commands/required_option.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/user_commands/management/commands/required_option.py b/tests/user_commands/management/commands/required_option.py
new file mode 100644
index 0000000000..3b30ed942e
--- /dev/null
+++ b/tests/user_commands/management/commands/required_option.py
@@ -0,0 +1,11 @@
+from django.core.management.base import BaseCommand
+
+
+class Command(BaseCommand):
+
+ def add_arguments(self, parser):
+ parser.add_argument('-n', '--need-me', required=True)
+ parser.add_argument('-t', '--need-me-too', required=True, dest='needme2')
+
+ def handle(self, *args, **options):
+ self.stdout.write(','.join(options))