summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Turcotte <maxime.turcotte@savoirfairelinux.com>2014-06-17 19:07:54 -0400
committerTim Graham <timograham@gmail.com>2014-06-19 08:54:59 -0400
commit9996158db467f9bef8243fcc36dc3602570e3613 (patch)
treebf3b5cb36e3083b84de592d6e9da4fd2d131c5f4
parent63670a474c14b1989f1a3f4ee7fd0fbacb5a764a (diff)
Fixed #22835 -- Deprecated NoArgsCommand.
-rw-r--r--django/contrib/sessions/management/commands/clearsessions.py6
-rw-r--r--django/contrib/staticfiles/management/commands/collectstatic.py12
-rw-r--r--django/core/management/base.py8
-rw-r--r--django/core/management/commands/diffsettings.py6
-rw-r--r--django/core/management/commands/flush.py6
-rw-r--r--django/core/management/commands/inspectdb.py6
-rw-r--r--django/core/management/commands/makemessages.py6
-rw-r--r--django/core/management/commands/shell.py6
-rw-r--r--django/core/management/commands/sqlflush.py6
-rw-r--r--django/core/management/commands/syncdb.py6
-rw-r--r--django/core/management/commands/validate.py4
-rw-r--r--docs/howto/custom-management-commands.txt8
-rw-r--r--docs/internals/deprecation.txt4
-rw-r--r--docs/releases/1.8.txt7
-rw-r--r--tests/admin_scripts/complex_app/management/commands/duplicate.py6
-rw-r--r--tests/admin_scripts/management/commands/color_command.py6
-rw-r--r--tests/admin_scripts/management/commands/noargs_command.py8
-rw-r--r--tests/admin_scripts/management/commands/validation_command.py6
-rw-r--r--tests/admin_scripts/simple_app/management/commands/duplicate.py6
-rw-r--r--tests/admin_scripts/tests.py40
20 files changed, 94 insertions, 69 deletions
diff --git a/django/contrib/sessions/management/commands/clearsessions.py b/django/contrib/sessions/management/commands/clearsessions.py
index fa0dad31c3..23e7f143e0 100644
--- a/django/contrib/sessions/management/commands/clearsessions.py
+++ b/django/contrib/sessions/management/commands/clearsessions.py
@@ -1,13 +1,13 @@
from importlib import import_module
from django.conf import settings
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Can be run as a cronjob or directly to clean out expired sessions (only with the database backend at the moment)."
- def handle_noargs(self, **options):
+ def handle(self, **options):
engine = import_module(settings.SESSION_ENGINE)
try:
engine.SessionStore.clear_expired()
diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py
index 714f36e1de..2d2413e808 100644
--- a/django/contrib/staticfiles/management/commands/collectstatic.py
+++ b/django/contrib/staticfiles/management/commands/collectstatic.py
@@ -4,7 +4,8 @@ import os
from collections import OrderedDict
from django.core.files.storage import FileSystemStorage
-from django.core.management.base import CommandError, NoArgsCommand
+from django.core.management.base import CommandError, BaseCommand
+from django.core.management.color import no_style
from django.utils.encoding import smart_text
from django.utils.six.moves import input
@@ -12,7 +13,7 @@ from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
-class Command(NoArgsCommand):
+class Command(BaseCommand):
"""
Command that allows to copy or symlink static files from different
locations to the settings.STATIC_ROOT.
@@ -21,12 +22,13 @@ class Command(NoArgsCommand):
requires_system_checks = False
def __init__(self, *args, **kwargs):
- super(NoArgsCommand, self).__init__(*args, **kwargs)
+ super(BaseCommand, self).__init__(*args, **kwargs)
self.copied_files = []
self.symlinked_files = []
self.unmodified_files = []
self.post_processed_files = []
self.storage = staticfiles_storage
+ self.style = no_style()
try:
self.storage.path('')
except NotImplementedError:
@@ -79,7 +81,7 @@ class Command(NoArgsCommand):
"""
Perform the bulk of the work of collectstatic.
- Split off from handle_noargs() to facilitate testing.
+ Split off from handle() to facilitate testing.
"""
if self.symlink and not self.local:
raise CommandError("Can't symlink to a remote destination.")
@@ -130,7 +132,7 @@ class Command(NoArgsCommand):
'post_processed': self.post_processed_files,
}
- def handle_noargs(self, **options):
+ def handle(self, **options):
self.set_options(**options)
message = ['\n']
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 99997059dc..2f8664f128 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -603,6 +603,14 @@ class NoArgsCommand(BaseCommand):
"""
args = ''
+ def __init__(self):
+ warnings.warn(
+ "NoArgsCommand class is deprecated and will be removed in Django 2.0. "
+ "Use BaseCommand instead, which takes no arguments by default.",
+ RemovedInDjango20Warning
+ )
+ super(NoArgsCommand, self).__init__()
+
def handle(self, *args, **options):
if args:
raise CommandError("Command doesn't accept any arguments")
diff --git a/django/core/management/commands/diffsettings.py b/django/core/management/commands/diffsettings.py
index cb31894aa8..ac724fca3f 100644
--- a/django/core/management/commands/diffsettings.py
+++ b/django/core/management/commands/diffsettings.py
@@ -1,4 +1,4 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
@@ -6,7 +6,7 @@ def module_to_dict(module, omittable=lambda k: k.startswith('_')):
return dict((k, repr(v)) for k, v in module.__dict__.items() if not omittable(k))
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = """Displays differences between the current settings.py and Django's
default settings. Settings that don't appear in the defaults are
followed by "###"."""
@@ -18,7 +18,7 @@ class Command(NoArgsCommand):
help='Display all settings, regardless of their value. '
'Default values are prefixed by "###".')
- def handle_noargs(self, **options):
+ def handle(self, **options):
# Inspired by Postfix's "postconf -n".
from django.conf import settings, global_settings
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index fc2256d2e0..ccbc47bd90 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -4,14 +4,14 @@ from importlib import import_module
from django.apps import apps
from django.db import connections, router, transaction, DEFAULT_DB_ALIAS
from django.core.management import call_command
-from django.core.management.base import NoArgsCommand, CommandError
+from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import sql_flush, emit_post_migrate_signal
from django.utils.six.moves import input
from django.utils import six
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = ('Removes ALL DATA from the database, including data added during '
'migrations. Unmigrated apps will also have their initial_data '
'fixture reloaded. Does not achieve a "fresh install" state.')
@@ -26,7 +26,7 @@ class Command(NoArgsCommand):
dest='load_initial_data', default=True,
help='Tells Django not to load any initial data after database synchronization.')
- def handle_noargs(self, **options):
+ def handle(self, **options):
database = options.get('database')
connection = connections[database]
verbosity = options.get('verbosity')
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 783dcc06f3..1eecf29dc6 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -4,11 +4,11 @@ from collections import OrderedDict
import keyword
import re
-from django.core.management.base import NoArgsCommand, CommandError
+from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Introspects the database tables in the given database and outputs a Django model module."
requires_system_checks = False
@@ -20,7 +20,7 @@ class Command(NoArgsCommand):
default=DEFAULT_DB_ALIAS, help='Nominates a database to '
'introspect. Defaults to using the "default" database.')
- def handle_noargs(self, **options):
+ def handle(self, **options):
try:
for line in self.handle_inspection(options):
self.stdout.write("%s\n" % line)
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 7f3f24428d..120847bd5d 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -9,7 +9,7 @@ import sys
from itertools import dropwhile
import django
-from django.core.management.base import CommandError, NoArgsCommand
+from django.core.management.base import CommandError, BaseCommand
from django.core.management.utils import (handle_extensions, find_command,
popen_wrapper)
from django.utils.encoding import force_str
@@ -162,7 +162,7 @@ def write_pot_file(potfile, msgs):
fp.write(msgs)
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = ("Runs over the entire source tree of the current directory and "
"pulls out all strings marked for translation. It creates (or updates) a message "
"file in the conf/locale (in the django tree) or locale (for projects and "
@@ -210,7 +210,7 @@ class Command(NoArgsCommand):
parser.add_argument('--keep-pot', action='store_true', dest='keep_pot',
default=False, help="Keep .pot file after making messages. Useful when debugging.")
- def handle_noargs(self, *args, **options):
+ def handle(self, *args, **options):
locale = options.get('locale')
exclude = options.get('exclude')
self.domain = options.get('domain')
diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
index d0c03030af..d8bded0673 100644
--- a/django/core/management/commands/shell.py
+++ b/django/core/management/commands/shell.py
@@ -1,9 +1,9 @@
import os
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available."
requires_system_checks = False
shells = ['ipython', 'bpython']
@@ -60,7 +60,7 @@ class Command(NoArgsCommand):
pass
raise ImportError
- def handle_noargs(self, **options):
+ def handle(self, **options):
try:
if options['plain']:
# Don't bother loading IPython, because the user wants plain Python.
diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py
index 48bc693611..a94ac79b67 100644
--- a/django/core/management/commands/sqlflush.py
+++ b/django/core/management/commands/sqlflush.py
@@ -1,11 +1,11 @@
from __future__ import unicode_literals
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
from django.core.management.sql import sql_flush
from django.db import connections, DEFAULT_DB_ALIAS
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed."
output_transaction = True
@@ -16,5 +16,5 @@ class Command(NoArgsCommand):
help='Nominates a database to print the SQL for. Defaults to the '
'"default" database.')
- def handle_noargs(self, **options):
+ def handle(self, **options):
return '\n'.join(sql_flush(self.style, connections[options['database']], only_django=True))
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
index 52b9dde956..b89ad62c3e 100644
--- a/django/core/management/commands/syncdb.py
+++ b/django/core/management/commands/syncdb.py
@@ -4,12 +4,12 @@ from django.apps import apps
from django.contrib.auth import get_user_model
from django.db import DEFAULT_DB_ALIAS
from django.core.management import call_command
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.six.moves import input
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Deprecated - use 'migrate' instead."
def add_arguments(self, parser):
@@ -20,7 +20,7 @@ class Command(NoArgsCommand):
parser.add_argument('--database', default=DEFAULT_DB_ALIAS,
help='Nominates a database to synchronize. Defaults to the "default" database.')
- def handle_noargs(self, **options):
+ def handle(self, **options):
warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning)
call_command("migrate", **options)
diff --git a/django/core/management/commands/validate.py b/django/core/management/commands/validate.py
index 490fe6c26f..9383746f1f 100644
--- a/django/core/management/commands/validate.py
+++ b/django/core/management/commands/validate.py
@@ -10,7 +10,7 @@ from django.utils.deprecation import RemovedInDjango19Warning
class Command(CheckCommand):
help = 'Deprecated. Use "check" command instead. ' + CheckCommand.help
- def handle_noargs(self, **options):
+ def handle(self, **options):
warnings.warn('"validate" has been deprecated in favor of "check".',
RemovedInDjango19Warning)
- super(Command, self).handle_noargs(**options)
+ super(Command, self).handle(**options)
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
index bb15597a34..c43af9672d 100644
--- a/docs/howto/custom-management-commands.txt
+++ b/docs/howto/custom-management-commands.txt
@@ -152,8 +152,8 @@ require a system-neutral string language (for which we use 'en-us').
If, for some reason, your custom management command needs to use a fixed locale
different from 'en-us', you should manually activate and deactivate it in your
-:meth:`~BaseCommand.handle` or :meth:`~NoArgsCommand.handle_noargs` method using
-the functions provided by the I18N support code:
+:meth:`~BaseCommand.handle` method using the functions provided by the I18N
+support code:
.. code-block:: python
@@ -431,6 +431,10 @@ Rather than implementing :meth:`~BaseCommand.handle`, subclasses must implement
.. class:: NoArgsCommand
+.. deprecated:: 1.8
+
+ Use :class:`BaseCommand` instead, which takes no arguments by default.
+
A command which takes no arguments on the command line.
Rather than implementing :meth:`~BaseCommand.handle`, subclasses must implement
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 82ffe4938f..39c42ae7bf 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -38,6 +38,10 @@ about each item can often be found in the release notes of two versions prior.
* Support for :py:mod:`optparse` will be dropped for custom management commands
(replaced by :py:mod:`argparse`).
+* The class :class:`~django.core.management.NoArgsCommand` will be removed. Use
+ :class:`~django.core.management.BaseCommand` instead, which takes no arguments
+ by default.
+
.. _deprecation-removed-in-1.9:
1.9
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 32de9ba631..54bfd2b2ea 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -471,3 +471,10 @@ to add custom arguments to commands has changed: instead of extending the
:meth:`~django.core.management.BaseCommand.add_arguments` method and add
arguments through ``argparse.add_argument()``. See
:ref:`this example <custom-commands-options>` for more details.
+
+``django.core.management.NoArgsCommand``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The class :class:`~django.core.management.NoArgsCommand` is now deprecated and
+will be removed in Django 2.0. Use :class:`~django.core.management.BaseCommand`
+instead, which takes no arguments by default.
diff --git a/tests/admin_scripts/complex_app/management/commands/duplicate.py b/tests/admin_scripts/complex_app/management/commands/duplicate.py
index 11b183843f..f217620ab9 100644
--- a/tests/admin_scripts/complex_app/management/commands/duplicate.py
+++ b/tests/admin_scripts/complex_app/management/commands/duplicate.py
@@ -1,7 +1,7 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
- def handle_noargs(self, **options):
+ def handle(self, **options):
self.stdout.write('complex_app')
diff --git a/tests/admin_scripts/management/commands/color_command.py b/tests/admin_scripts/management/commands/color_command.py
index dda2cc826d..5a1c297762 100644
--- a/tests/admin_scripts/management/commands/color_command.py
+++ b/tests/admin_scripts/management/commands/color_command.py
@@ -1,9 +1,9 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Test color output"
requires_system_checks = False
- def handle_noargs(self, **options):
+ def handle(self, **options):
return self.style.SQL_KEYWORD('BEGIN')
diff --git a/tests/admin_scripts/management/commands/noargs_command.py b/tests/admin_scripts/management/commands/noargs_command.py
index 3a75098c71..c95f7c1844 100644
--- a/tests/admin_scripts/management/commands/noargs_command.py
+++ b/tests/admin_scripts/management/commands/noargs_command.py
@@ -1,9 +1,9 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
help = "Test No-args commands"
requires_system_checks = False
- def handle_noargs(self, **options):
- print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items()))
+ def handle(self, **options):
+ print('EXECUTE: noargs_command options=%s' % sorted(options.items()))
diff --git a/tests/admin_scripts/management/commands/validation_command.py b/tests/admin_scripts/management/commands/validation_command.py
index e9ba86dc6c..d0cbe19a81 100644
--- a/tests/admin_scripts/management/commands/validation_command.py
+++ b/tests/admin_scripts/management/commands/validation_command.py
@@ -1,11 +1,11 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class InvalidCommand(NoArgsCommand):
+class InvalidCommand(BaseCommand):
help = ("Test raising an error if both requires_system_checks "
"and requires_model_validation are defined.")
requires_system_checks = True
requires_model_validation = True
- def handle_noargs(self, **options):
+ def handle(self, **options):
pass
diff --git a/tests/admin_scripts/simple_app/management/commands/duplicate.py b/tests/admin_scripts/simple_app/management/commands/duplicate.py
index a451f3991c..18cd0aab08 100644
--- a/tests/admin_scripts/simple_app/management/commands/duplicate.py
+++ b/tests/admin_scripts/simple_app/management/commands/duplicate.py
@@ -1,7 +1,7 @@
-from django.core.management.base import NoArgsCommand
+from django.core.management.base import BaseCommand
-class Command(NoArgsCommand):
+class Command(BaseCommand):
- def handle_noargs(self, **options):
+ def handle(self, **options):
self.stdout.write('simple_app')
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index ec7f47ac36..b2da37b8d9 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -282,14 +282,14 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase):
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"default: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
@@ -349,14 +349,14 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"fulldefault: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class DjangoAdminMinimalSettings(AdminScriptTestCase):
@@ -483,14 +483,14 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase):
args = ['noargs_command', '--settings=test_project.alternate_settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"alternate: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class DjangoAdminMultipleSettings(AdminScriptTestCase):
@@ -553,14 +553,14 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase):
args = ['noargs_command', '--settings=test_project.alternate_settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"alternate: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class DjangoAdminSettingsDirectory(AdminScriptTestCase):
@@ -718,21 +718,21 @@ class ManageDefaultSettings(AdminScriptTestCase):
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_settings(self):
"default: manage.py can execute user commands when settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"default: manage.py can execute user commands when settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class ManageFullPathDefaultSettings(AdminScriptTestCase):
@@ -785,21 +785,21 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase):
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_settings(self):
"fulldefault: manage.py can execute user commands when settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"fulldefault: manage.py can execute user commands when settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class ManageMinimalSettings(AdminScriptTestCase):
@@ -929,21 +929,21 @@ class ManageAlternateSettings(AdminScriptTestCase):
"alternate: manage.py can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=alternate_settings']
out, err = self.run_manage(args)
- self.assertOutput(out, "EXECUTE:NoArgsCommand options=[('no_color', False), ('pythonpath', None), ('settings', 'alternate_settings'), ('traceback', False), ('verbosity', 1)]")
+ self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', False), ('pythonpath', None), ('settings', 'alternate_settings'), ('traceback', False), ('verbosity', 1)]")
self.assertNoOutput(err)
def test_custom_command_with_environment(self):
"alternate: manage.py can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'alternate_settings')
- self.assertOutput(out, "EXECUTE:NoArgsCommand options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
+ self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
self.assertNoOutput(err)
def test_custom_command_output_color(self):
"alternate: manage.py output syntax color can be deactivated with the `--no-color` option"
args = ['noargs_command', '--no-color', '--settings=alternate_settings']
out, err = self.run_manage(args)
- self.assertOutput(out, "EXECUTE:NoArgsCommand options=[('no_color', True), ('pythonpath', None), ('settings', 'alternate_settings'), ('traceback', False), ('verbosity', 1)]")
+ self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', True), ('pythonpath', None), ('settings', 'alternate_settings'), ('traceback', False), ('verbosity', 1)]")
self.assertNoOutput(err)
@@ -1008,14 +1008,14 @@ class ManageMultipleSettings(AdminScriptTestCase):
args = ['noargs_command', '--settings=alternate_settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
def test_custom_command_with_environment(self):
"multiple: manage.py can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'alternate_settings')
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand")
+ self.assertOutput(out, "EXECUTE: noargs_command")
class ManageSettingsWithSettingsErrors(AdminScriptTestCase):
@@ -1496,7 +1496,7 @@ class CommandTypes(AdminScriptTestCase):
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
- self.assertOutput(out, "EXECUTE:NoArgsCommand options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
+ self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
def test_noargs_with_args(self):
"NoArg Commands raise an error if an argument is provided"