summaryrefslogtreecommitdiff
path: root/tests/admin_scripts/tests.py
AgeCommit message (Collapse)Author
2014-10-22Made testing of stdout and stderr more consistent.Loic Bistuer
Refs #23663.
2014-10-22Fixed #23663 -- Initialize output streams for BaseCommand in __init__().Loic Bistuer
This helps with testability of management commands. Thanks to trac username daveoncode for the report and to Tim Graham and Claude Paroz for the reviews.
2014-10-22Fixed #23107 -- Made runserver output respect --no-color.Loic Bistuer
This commit reverts 67d7da5fb9498b811f0168f5df2308ad4743027f. The previous fix changed the environment globally, which meant that any call to `call_command(no_color=True)` prevented further `call_command` with color. This fix still relies on the environment because it's currently the only way to reach WSGIRequestHandler, but it's now limited to the `runserver` command. This seems an acceptable compromise considering `runserver` runs indefinitely. Thanks Tim Graham for the review.
2014-09-17Fixed #23495 -- Stopped swallowing real settings import errorClaude Paroz
Thanks papaloizouc for the report.
2014-08-18Fixed #23136 -- Added a message when sqlclear does nothingGabriel Muñumel
2014-07-30Fixed #23107 -- Made runserver output respect --no-color.areski
2014-06-19Fixed #22835 -- Deprecated NoArgsCommand.Maxime Turcotte
2014-06-14Fixed #7762 -- Hidden full script name in command error outputClaude Paroz
2014-06-14Restored command error behavior when called from command lineClaude Paroz
Refs #19973.
2014-06-14Converted remaining management commands to argparseClaude Paroz
2014-06-14Fixed #19973 -- Replaced optparse by argparse in management commandsClaude Paroz
Thanks Tim Graham for the review.
2014-06-13Fixed #22477 -- Removed contrib middleware from the global settings defaults.mlavin
Also added a compatibility check for changed middleware defaults. Forwardport of d94de802d3 from stable/1.7.x
2014-05-16Fixed #21634 -- Prevented hiding ImproperlyConfigured when command not foundClaude Paroz
Thanks nikolay.v.golub@gmail.com for the report.
2014-04-26Fix many many typos in comments throughout the codebaseAlex Gaynor
2014-04-06Fixed #21977 -- Deprecated SimpleTestCase.urlsAnubhav Joshi
2014-03-11Fixed test failures on Windows.Tim Graham
refs #21092 and 8d7e048a8b428bebe82be735a84570f9250441e6
2014-03-08Improved compatibility in admin_scripts testsClaude Paroz
Environment keys/values need to use native strings on some plateforms. Thanks anubhav joshi for detecting the issue and helping shaping the patch.
2014-03-08Fixed #21092 -- Ensured admin_scripts tests are run with warnings offClaude Paroz
2014-03-08Avoided modifying current environment in admin_scripts testsClaude Paroz
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2014-02-18Fixed #22057 -- Ensured reverse_lazy can be used in settingsClaude Paroz
And without causing a circular import. Thanks Akis Kesoglou for the report.
2014-01-28Fixed #21849 -- Included the count of silenced system checks in output.Tim Graham
2014-01-25Fixed #21829 -- Added default AppConfigs.Aymeric Augustin
Thanks Russell for the report, Marc for the initial patch, Carl for the final review, and everyone who contributed to the design discussion.
2014-01-20Added warning silencers to some noisy tests.Russell Keith-Magee
These warnings all emerged as the result of the introduction of the checks framework. Thanks to Anssi Kääriäinen for the report.
2014-01-20Fixed #16905 -- Added extensible checks (nee validation) frameworkRussell Keith-Magee
This is the result of Christopher Medrela's 2013 Summer of Code project. Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian Apolloner, and Alex Gaynor for review notes along the way. Also: Fixes #8579, fixes #3055, fixes #19844.
2014-01-14Fixed #21774 -- Isolate all test urls from eachother.Marc Tamlyn
This (nearly) completes the work to isolate all the test modules from each other. This is now more important as importing models from another module will case PendingDeprecationWarnings if those modules are not in INSTALLED_APPS. The only remaining obvious dependencies are: - d.c.auth depends on d.c.admin (because of the is_admin flag to some views), but this is not so important and d.c.admin is in always_installed_apps - test_client_regress depends on test_client. Eventually these should become a single module, as the split serves no useful purpose.
2014-01-01Fixed #21018 -- Reversed precedence order for management commands.Aymeric Augustin
2013-12-28Used app_label instead of appname.Aymeric Augustin
The last component of the dotted path to the application module is consistently referenced as the application "label". For instance it's AppConfig.label. appname could be confused with AppConfig.name, which is the full dotted path.
2013-12-28Migrated built-in AppCommands to use handle_app_config.Aymeric Augustin
2013-12-22Deprecated load_app().Aymeric Augustin
Adjusted several tests that used it to add apps to the app cache and then attempted to remove them by manipulating attributes directly. Also renamed invalid_models to invalid_models_tests to avoid clashing application labels between the outer and the inner invalid_models applications.
2013-12-22Removed the only_installed argument of get_app_config[s].Aymeric Augustin
It wasn't used anywhere and couldn't be implemented any more since non-installed apps no longer have a configuration.
2013-12-17Added get_app_config() to look up app configs by label.Aymeric Augustin
Refactored get_app() to rely on that method. get_app() starts by calling _populate(), which goes through INSTALLED_APPS and, for each app, imports the app module and attempts to import the models module. At this point, no further imports are necessary to return the models module for a given app. Therefore, the implementation of get_app() can be simplified and the safeguards for race conditions can be removed. Besides, the emptyOK parameter isn't used anywhere in Django. It was introduced in d6c95e93 but not actually used nor documented, and it has just been carried around since then. Since it's an obscure private API, it's acceptable to stop supporting it without a deprecation path. This branch aims at providing first-class support for applications without a models module eventually. For backwards-compatibility, get_app() still raises ImproperlyConfigured when an app isn't found, even though LookupError is technically more correct. I haven't gone as far as to preserve the exact error messages. I've adjusted a few tests instead.
2013-11-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-10-23Fixed #21298 -- Fixed E301 pep8 warningsAlasdair Nicol
2013-10-23Workaround admin scripts test failures on Windows+Python 3.Ramiro Morales
Change strategy used to examine instrumented output to acommodate the fact that on Windows, where the path separator is '\', repr() of Python modules has changed in Python 3 to use escaped backslashes in the FS path section (e.g. 'C:\\python3x\\Lib\\site-packages\\django\\contrib\\auth\\models.py') without having to special-case based on platform.
2013-10-21Fixed #19724 -- Output note when showing only core management commandsClaude Paroz
When listing available management commands, only core commands are listed if settings have any error. This commit adds a note in this case so errors are not totally silently skipped. Thanks Peter Davis for the report.
2013-10-17Fixed #21284 -- Prevented KeyError swallowing in fetch_commandClaude Paroz
Thanks wildfire for the report.
2013-10-14Fixed #21269 -- Don't crash when CommandError contains non-asciiClaude Paroz
Thanks kontakt@eikefoken.de for the report.
2013-10-10Whitespace cleanup.Tim Graham
* Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
2013-09-29Modified test added in 3afb5916b2 so it doesn't fail on Windows.Ramiro Morales
Refs #18091.
2013-09-08Removed a ton of unused local varsAlex Gaynor
2013-07-30Removed part of a test that doesn't work on Jenkins; refs #19877.Tim Graham
2013-07-30Fixed a test that depended on the DB backend; refs #19877. Thanks Loic.Tim Graham
2013-07-30Fixed #19877 -- Added `--no-color` option to `BaseCommand` to avoid using ↵Jose L. Patino
output styles.
2013-07-29Add utf-8 preamble to admin_scripts temp settings fileClaude Paroz
As some settings are copied from current user settings, we cannot be sure the characters are pure ascii.
2013-07-01Stopped using django.utils.unittest in the test suite.Aymeric Augustin
Refs #20680.
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-06-10Defined available_apps in relevant tests.Aymeric Augustin
Fixed #20483.
2013-06-09Added runserver validation to detect if DEBUG=False and ALLOWED_HOSTS is empty.Tim Graham
Refs #19875.
2013-05-30Fixed #20509 - Proper parsing for dumpdata --pks option.Tim Graham
Thanks weipin for the report and Baptiste Mispelon for the patch.