From fee8a498660374cfe9e710bd96d6f84fa64c1a2d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 21 Feb 2011 14:06:28 +0000 Subject: [1.2.X] Fixed #15359 -- Ensure that the -h option is always honored by django-admin.py. Thanks to teubank for the report. Backport of r15605 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15609 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_scripts/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/regressiontests/admin_scripts') diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 2a7f3023c1..b3e826f74b 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -1031,6 +1031,16 @@ class CommandTypes(AdminScriptTestCase): self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") self.assertOutput(err, "Type 'manage.py help ' for help on a specific subcommand.") + def test_short_help(self): + "-h is handled as a short form of --help" + args = ['-h'] + out, err = self.run_manage(args) + if sys.version_info < (2, 5): + self.assertOutput(out, "usage: manage.py subcommand [options] [args]") + else: + self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") + self.assertOutput(err, "Type 'manage.py help ' for help on a specific subcommand.") + def test_specific_help(self): "--help can be used on a specific command" args = ['sqlall','--help'] -- cgit v1.3