summaryrefslogtreecommitdiff
path: root/tests/user_commands
AgeCommit message (Collapse)Author
2025-12-22Fixed #36376 -- Fixed --no-color for command help in Python 3.14+.Skyiesac
https://github.com/python/cpython/pull/136809 made `color` default to True in ArgumentParser.
2025-11-20Fixed #36321 -- Defaulted suggest_on_error=True in management commands.kihuni
Python 3.15 defaults suggest_on_error=True, but the feature is available from 3.14, so this change opts in earlier. This change can be reverted when Python 3.15 is the minimum supported version.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-01Fixed #36479 -- Improved how FileNotFoundError is triggered in code ↵Roel Delos Reyes
formatter tests. Ensured the test for formatter subprocess FileNotFoundError doesn't rely on platform-specific behavior, improving reliability on macOS and other systems by consistently using pathlib to build test paths.
2025-01-04Fixed #36056 -- Made OutputWrapper a virtual subclass of TextIOBase.Adam Johnson
This fixes the ignored exception in self._out.flush() from django.core.management.base.OutputWrapper: `ValueError: I/O operation on closed file.`
2024-11-29Fixed #35308 -- Handled OSError when launching code formatters.Jacob Walls
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-10-29Refs #35844 -- Expanded compatibility for expected error messages in command ↵Tainara Palmeira
tests on Python 3.12 and 3.13. Updated CommandTests.test_subparser_invalid_option and CommandDBOptionChoiceTests.test_invalid_choice_db_option to use assertRaisesRegex() for compatibility with modified error messages in Python 3.12, 3.13, and 3.14+..
2024-10-25Refs #35844 -- Corrected expected error messages in commands tests on Python ↵Tainara Palmeira
3.14+. Updated CommandTests.test_subparser_invalid_option and CommandDBOptionChoiceTests.test_invalid_choice_db_option to address changes in Python 3.14+ error handling.
2023-07-27Simplified call_command() calls.Nick Pope
2023-02-03Fixed #34259 -- Passed called_from_command_line to command subparsers.Adam Johnson
2023-01-11Refs #31546, Refs #34118 -- Corrected ↵Mariusz Felisiak
CommandTests.test_requires_system_checks_specific(). System checks are never called without skip_checks=False. Moreover, called_once_with() is not a proper assertion and raise AttributeError on Python 3.12.
2022-06-20Fixed #33657 -- Allowed customizing formatter class of argument parsers.Abhinav Yadav
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-10-25Fixed #33205 -- Made call_command() raise TypeError when dest with multiple ↵Hasan Ramezani
arguments is passed.
2021-09-20Refs #31546 -- Removed support for boolean values in ↵Mariusz Felisiak
Command.requires_system_checks. Per deprecation timeline.
2021-09-02Fixed #33082 -- Fixed CommandTests.test_subparser_invalid_option on Python ↵Mariusz Felisiak
3.9.7+. Thanks Michał Górny for the report.
2021-08-04Refs #32074 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.10+.Michał Górny
Python 3.10.0rc1 changed the error messages issued by argparse on invalid choice to include the argument name. Update the expected test output to account for that.
2021-02-10Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak
2020-10-30Fixed #32153 -- Fixed management commands when using required list options.Hasan Ramezani
Thanks Mark Gajdosik for the report and initial patch.
2020-10-09Fixed #32094 -- Fixed flush() calls on management command self.stdout/err ↵Thomas Riccardi
proxies.
2020-10-06Refs #32047 -- Added test for using call_command() with constant required ↵Hasan Ramezani
options.
2020-09-30Fixed #32047 -- Fixed call_command() crash if a constant option from ↵Hasan Ramezani
required mutually exclusive group is passed in options.
2020-06-01Reverted "Refs #23919 -- Removed obsolete __init__.py files in management ↵René Fleschenberg
command directories." This reverts commit ccc25bfe4f0964a00df3af6f91c2d9e20159a0c2. https://groups.google.com/d/topic/django-developers/GVHMH2ciAnk/discussion
2020-05-21Fixed #31546 -- Allowed specifying list of tags in ↵Hasan Ramezani
Command.requires_system_checks.
2020-04-20Disabled management commands output with verbosity 0 in various tests.François Freitag
Instead of capturing the command output and discard it immediately, tell the command not to log.
2020-04-14Refs #29501 -- Allowed customizing exit status for management commands.Adam Johnson
2020-04-07Fixed #31428 -- Allowed empty message in management command self.stdout/err ↵François Freitag
proxies.
2019-09-06Fixed #30763 -- Fixed management commands when using required mutually ↵Hasan Ramezani
exclusive groups.
2019-06-28Fixed #30584 -- Fixed management command when using subparsers with dest ↵Hasan Ramezani
parameter.
2019-04-30Fixed #30418 -- Added --skip-checks management command option.Jon Dufresne
2019-02-05Simplified temporary directory handling in AdminScriptTestCase.Jon Dufresne
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-01-28Refs #29973 -- Extracted helper functions from makemessages.rsiemens
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
2018-09-11Fixed #29560 -- Added --force-color management command option.Hasan Ramezani
2018-08-05Added test for django.core.management.utils.get_random_secret_key().Hasan Ramezani
2018-07-02Removed parser.add_arguments() arguments that match the defaults.Claude Paroz
2018-06-16Fixed #29152 -- Allowed passing kwargs to ArgumentParser initialization in ↵humbertotm
management commands.
2018-06-06Fixed #29301 -- Added custom help formatter to BaseCommand classClaude Paroz
This partially reverts c3055242c81812278ebdc93dd109f30d2cbd1610. Thanks Adam Johnson and Carlton Gibson for the reviews.
2018-05-14Fixed #29392 -- Disallowed use of abbreviated forms of --settings and ↵Ryan P Kilby
--pythonpath management command options.
2018-05-13Fixed #17379 -- Removed management commands deactivation of the locale.Claude Paroz
2018-04-21Fixed #29295 -- Fixed management command crash when using subparsers.Hasan Ramezani
Thanks Tim Graham for the fix.
2018-03-02Fixed #29133 -- Fixed call_command() crash if a required option is passed in ↵Alex Tomic
options.
2018-01-03Refs #23919 -- Removed obsolete __init__.py files in management command ↵я котик пур-пур
directories.
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-06-16Fixed #27787 -- Made call_command() validate the options it receives.Chandrakant Kumar
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-04-01Removed implicit default store_true/false argparse args.Jon Dufresne
argparse automatically sets the default value for store_true/false arguments to its opposite.
2017-01-20Refs #23919 -- Removed django.test.mock Python 2 compatibility shim.Tim Graham
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.