Ticket #9158: django-admin-stdout_with_test.diff
File django-admin-stdout_with_test.diff, 2.2 KB (added by , 14 years ago) |
---|
-
tests/regressiontests/admin_scripts/tests.py
1113 1113 self.assertOutput(out, "usage: manage.py subcommand [options] [args]") 1114 1114 else: 1115 1115 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1116 self.assertOutput( err, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")1116 self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.") 1117 1117 1118 1118 def test_short_help(self): 1119 1119 "-h is handled as a short form of --help" … … 1123 1123 self.assertOutput(out, "usage: manage.py subcommand [options] [args]") 1124 1124 else: 1125 1125 self.assertOutput(out, "Usage: manage.py subcommand [options] [args]") 1126 self.assertOutput( err, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")1126 self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.") 1127 1127 1128 1128 def test_specific_help(self): 1129 1129 "--help can be used on a specific command" -
django/core/management/__init__.py
365 365 self.fetch_command(args[2]).print_help(self.prog_name, args[2]) 366 366 else: 367 367 parser.print_lax_help() 368 sys.std err.write(self.main_help_text() + '\n')368 sys.stdout.write(self.main_help_text() + '\n') 369 369 sys.exit(1) 370 370 # Special-cases: We want 'django-admin.py --version' and 371 371 # 'django-admin.py --help' to work, for backwards compatibility. … … 374 374 pass 375 375 elif self.argv[1:] in (['--help'], ['-h']): 376 376 parser.print_lax_help() 377 sys.std err.write(self.main_help_text() + '\n')377 sys.stdout.write(self.main_help_text() + '\n') 378 378 else: 379 379 self.fetch_command(subcommand).run_from_argv(self.argv) 380 380