Commit Graph

69 Commits

Author SHA1 Message Date
François Freitag c86201b6ed Disabled management commands output with verbosity 0 in various tests.
Instead of capturing the command output and discard it immediately,
tell the command not to log.
2020-04-20 09:09:26 +02:00
Adam Johnson 8e8c3f964e Refs -- Allowed customizing exit status for management commands. 2020-04-14 13:22:47 +02:00
François Freitag e03eb8db93 Fixed -- Allowed empty message in management command self.stdout/err proxies. 2020-04-07 08:45:11 +02:00
Hasan Ramezani 6c379f1a18 Fixed -- Fixed management commands when using required mutually exclusive groups. 2019-09-06 10:55:24 +02:00
Hasan Ramezani 2b03e8e9e8 Fixed -- Fixed management command when using subparsers with dest parameter. 2019-06-28 12:51:26 +02:00
Jon Dufresne 6866c91b63 Fixed -- Added --skip-checks management command option. 2019-04-30 10:48:30 +02:00
Jon Dufresne 487d904bf2 Simplified temporary directory handling in AdminScriptTestCase.
Use tempfile.TemporaryDirectory() in AdminScriptTestCase.setUp()
to create and destroy a temporary directory for each test. It removes
the need for individual tests to delete files.

For test classes that don't use the temporary directory, inherit from
SimpleTestCase.
2019-02-05 12:11:54 -05:00
rsiemens bc9f0b3203 Refs -- Extracted helper functions from makemessages. 2019-01-28 18:23:41 -05:00
Tim Graham 043bd70942 Updated test URL patterns to use path() and re_path(). 2018-12-31 10:47:32 -05:00
Hasan Ramezani 5195b99e2c Fixed -- Added --force-color management command option. 2018-09-11 11:15:42 -04:00
Hasan Ramezani 03e918d717 Added test for django.core.management.utils.get_random_secret_key(). 2018-08-05 16:06:31 -04:00
Claude Paroz eac9ab7ebb Removed parser.add_arguments() arguments that match the defaults. 2018-07-02 17:54:57 -04:00
humbertotm e95008f241 Fixed -- Allowed passing kwargs to ArgumentParser initialization in management commands. 2018-06-16 15:54:59 -04:00
Claude Paroz ce3351b950 Fixed -- Added custom help formatter to BaseCommand class
This partially reverts c3055242c8.
Thanks Adam Johnson and Carlton Gibson for the reviews.
2018-06-06 19:16:10 +02:00
Ryan P Kilby 2dcc5d629a Fixed -- Disallowed use of abbreviated forms of --settings and --pythonpath management command options. 2018-05-14 22:18:22 -04:00
Claude Paroz d65b0f72de Fixed -- Removed management commands deactivation of the locale. 2018-05-13 10:21:53 +02:00
Hasan Ramezani dd68b51e1d Fixed -- Fixed management command crash when using subparsers.
Thanks Tim Graham for the fix.
2018-04-21 17:33:17 -04:00
Alex Tomic a1a3e51561 Fixed -- Fixed call_command() crash if a required option is passed in options. 2018-03-02 12:25:08 -05:00
я котик пур-пур ccc25bfe4f Refs -- Removed obsolete __init__.py files in management command directories. 2018-01-03 11:02:26 -05:00
Mads Jensen a51c4de194 Used assertRaisesMessage() to test Django's error messages. 2017-07-29 19:07:23 -04:00
Chandrakant Kumar 2b09e4c88e Fixed -- Made call_command() validate the options it receives. 2017-06-16 21:28:38 -04:00
Jon Dufresne 21046e7773 Fixed -- Removed unnecessary dict.keys() calls.
iter(dict) is equivalent to iter(dict.keys()).
2017-05-27 19:08:46 -04:00
Jon Dufresne 7bbb5161ea Removed implicit default store_true/false argparse args.
argparse automatically sets the default value for store_true/false
arguments to its opposite.
2017-04-01 20:03:56 -04:00
Tim Graham 7aba69145d Refs -- Removed django.test.mock Python 2 compatibility shim. 2017-01-20 08:17:20 -05:00
Tim Graham 4e729feaa6 Refs -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
2017-01-20 08:01:02 -05:00
Claude Paroz 2b281cc35e Refs -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Adam Chainz 7dc8d9238a Skipped unnecessary system checks in user_commands test. 2017-01-09 17:23:24 -05:00
za 321e94fa41 Refs -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Claude Paroz 122c90a43b Fixed -- Removed BaseCommand.can_import_settings unused attribute
Thanks Tim Graham for the review.
2016-10-02 20:31:56 +02:00
Dmitry Dygalo ca32979cdc
Made miscellaneous code cleanups 2016-07-21 10:08:19 -04:00
Jon Dufresne 4f336f6652 Fixed -- Used more specific assertions in the Django test suite. 2016-06-16 14:19:18 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Claude Paroz b46c0ea6c8 Fixed -- Returned handle() result from call_command
Thanks Tim Graham for the review.
2016-02-23 09:12:12 +01:00
Tim Graham 1ac7fdcd13 Refs -- Added assertion for Command.requires_migrations_checks default. 2016-02-15 09:39:55 -05:00
Mounir Messelmeni 50931dfa53 Fixed -- Allowed management commands to check if migrations are applied. 2016-02-12 13:34:56 -05:00
Hasan 3d0dcd7f5a Refs -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Marten Kenbeek 16411b8400 Fixed -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
2015-12-31 14:21:29 -05:00
Claude Paroz 7d81ee6efc Fixed -- Set script prefix even outside of requests
Thanks Tim Graham for the review.
2015-10-29 20:12:38 +01:00
Claude Paroz 3f22e83e90 Fixed -- Allowed passing non-string arguments to call_command
Thanks KS Chan for the report and Tim Graham for the review.
2015-10-03 14:40:33 +02:00
Tim Graham 6a70cb5397 Refs -- Removed optparse support in management commands per deprecation timeline. 2015-09-23 19:31:10 -04:00
Dražen Odobašić b1e33ceced Fixed -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Tim Graham aaacaeb096 Renamed RemovedInDjangoXYWarnings for new roadmap.
Forwardport of ae1d663b79
from stable/1.8.x plus more.
2015-06-24 16:08:20 -04:00
Rivo Laks a0047c6242 Fixed -- Cast optparse verbosity argument to an integer for better backwards compatibility.
Using `BaseCommand.options_list` makes Django use the legacy optparse
parser, which does not set the verbosity attribute correctly. Now the
verbosity argument is always cast to int. Regression in 8568638 ().

Initial report and patch from blueyed.
2015-06-09 19:03:23 -04:00
Tim Graham 197dd4b8f1 Prevented some test commands from needlessly running system checks.
This is a performance optimization and also fixes test errors with the
upcoming merge of contrib tests into tests/. The tests failed on MySQL
because the models with GeometryField were being checked but the
non-GIS MySQL backend didn't know how to handle them.
2015-02-11 10:14:38 -05:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs . 2015-02-06 08:16:28 -05:00
Claude Paroz 543df07720 Fixed -- Returned None for get_language when translations are deactivated
This fixes a regression caused by f7c287fca9. Thanks Markus Holtermann
for identifying the regression.
2015-01-08 17:43:07 +01:00
Claude Paroz f7c287fca9 Fixed -- Deactivated translations when leave_locale_alone is False
Thanks Tim Graham and Markus Holtermann for the reviews.
2015-01-07 20:11:24 +01:00
Claude Paroz 6e1c9c6568 Fixed -- Allowed management command discovery for eggs
Thanks jdetaeye for the report, bhuztez and jdetaeye for the
initial patches, Tim Graham and Berker Peksag for the reviews.
2015-01-05 17:19:35 +01:00
Claude Paroz 51890ce889 Applied ignore_warnings to Django tests 2014-12-30 18:16:25 +01:00
wrwrwr 6dbe979b4d Fixed -- Added copies of captured_std* managers from CPython's test.support.
StringIO import was adapted for compatibility with Python 2.
2014-11-29 11:21:58 -05:00