Jon Dufresne
0a01ca80d7
Refs #30241 -- Fixed BytesWarning emitted in test_translation tests.
2019-04-24 15:31:03 +02:00
Matthias Kestenholz
80482e9249
Fixes #30342 -- Removed a system check for LANGUAGES_BIDI setting.
...
This partly reverts commit 4400d8296d
.
2019-04-24 10:54:03 +02:00
Nick Pope
4400d8296d
Fixed #30241 -- Added more system checks of translation settings.
2019-03-28 20:10:50 +01:00
Nick Pope
d4783048ef
Refs #29713 -- Improved error message when LANGUAGE_CODE is invalid.
2019-03-28 20:04:24 +01:00
Nick Pope
a35bf4af72
Fixed typo in tests/check_framework/test_translation.py comment.
2019-03-09 13:17:50 +01:00
Simon Charette
8c775391b7
Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in favor of databases.
2019-01-10 19:11:21 -05:00
Tim Graham
043bd70942
Updated test URL patterns to use path() and re_path().
2018-12-31 10:47:32 -05:00
Sanyam Khurana
5d25804eaf
Fixed #20098 -- Added a check for model Meta.db_table collisions.
2018-12-24 10:40:11 -05:00
Tim Graham
193c109327
Switched TestCase to SimpleTestCase where possible in Django's tests.
2018-11-27 08:58:44 -05:00
Adam Johnson
245c36d7b6
Fixed #29642 -- Added check for arguments of custom error handler views.
2018-09-14 11:59:56 -04:00
Nick Pope
570402ffd7
Refs #29713 -- Improved error message from translation system check.
2018-09-06 13:49:25 +02:00
David
5db8d617c0
Fixed #29713 -- Added check that LANGUAGE_CODE uses standard language id format.
2018-09-03 10:43:55 +02:00
Mariusz Felisiak
362813d628
Fixed hanging indentation in various code.
2018-03-16 10:54:34 +01:00
Mariusz Felisiak
83a36ac49a
Removed unnecessary trailing commas and spaces in various code.
2017-12-28 21:07:29 +01:00
Tim Graham
532a4f22ad
Fixed invalid escape sequence warning in check_framework test.
2017-11-14 19:05:20 -05:00
Chris Lamb
998c9dd599
Fixed #28663 -- Add a check for likely incorrectly migrated django.urls.path() routes.
2017-11-07 11:39:59 -05:00
Sjoerd Job Postmus
df41b5a05d
Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201.
...
Thanks Aymeric Augustin for shepherding the DEP and patch review.
Thanks Marten Kenbeek and Tim Graham for contributing to the code.
Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.
2017-09-20 18:04:42 -04:00
Tim Graham
46dcdf9a29
Added a checks test for valid i18n patterns.
2017-09-20 10:23:28 -04:00
Mads Jensen
a51c4de194
Used assertRaisesMessage() to test Django's error messages.
2017-07-29 19:07:23 -04:00
Tim Graham
b23d264046
Fixed #27887 -- Fixed URLs check crash with namespaced URLs inside non-namespaced URLs.
2017-03-03 10:52:20 -05:00
Chris Lamb
8d4885ede5
Fixed #27874 -- Fixed URL namespace warning (urls.W005) for nested namespaces.
2017-02-24 10:13:48 -05:00
Tim Graham
ab83d4d8fe
Added multi_db=True to test cases that access the 'other' db connection.
...
Fixed a failure in the context processors tests when running in
reverse on MySQL due to an extra query after refs #27683 .
2017-02-10 08:19:32 -05:00
chillaranand
d6eaf7c018
Refs #23919 -- Replaced super(ClassName, self) with super().
2017-01-25 12:23:46 -05:00
Claude Paroz
2366100872
Removed unneeded force_text calls in the test suite
2017-01-24 18:45:54 +01:00
Tim Graham
7aba69145d
Refs #23919 -- Removed django.test.mock Python 2 compatibility shim.
2017-01-20 08:17:20 -05:00
Simon Charette
cecc079168
Refs #23919 -- Stopped inheriting from object to define new style classes.
2017-01-19 08:39:46 +01:00
Claude Paroz
2b281cc35e
Refs #23919 -- Removed most of remaining six usage
...
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz
d7b9aaa366
Refs #23919 -- Removed encoding preambles and future imports
2017-01-18 09:55:19 +01:00
Tim Graham
6192bffb13
Refs #26601 -- Removed obsolete system check for MIDDLEWARE_CLASSES setting.
2017-01-17 20:52:05 -05:00
Tim Graham
98760ab0b2
Refs #25079 -- Removed obsolete system check for TEMPLATE_* settings.
2017-01-17 20:52:05 -05:00
Tim Graham
d334f46b7a
Refs #26601 -- Removed support for old-style middleware using settings.MIDDLEWARE_CLASSES.
2017-01-17 20:52:04 -05:00
Adam Chainz
5eff8a7783
Fixed #25415 -- Made DiscoverRunner run system checks.
2016-12-29 12:33:24 -05:00
Adam Chainz
8669cf0e68
Fixed #27626 -- Moved MEDIA_URL/STATIC_URL validation to a system check.
2016-12-23 10:55:00 -05:00
Tim Graham
a04e795667
Wrapped an import per isort.
2016-12-21 17:05:59 -05:00
Andrew Nester
24fa728a47
Fixed #27612 -- Added a check for duplicate URL instance namespaces.
2016-12-21 16:54:15 -05:00
Tim Graham
c27104a9c7
Fixed #27611 -- Doc'd that CSRF_COOKIE_HTTPONLY setting offers no security.
2016-12-19 17:56:58 -05:00
Raphael Michel
33e86b3488
Refs #16859 -- Disabled CSRF_COOKIE_* checks when using CSRF_USE_SESSIONS.
2016-12-17 09:59:48 -05:00
Tim Graham
b5f0b3478d
Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.
2016-12-07 17:42:31 -05:00
Ramin Farajpour Cami
967be82443
Fixed E305 flake8 warnings.
2016-11-14 12:30:46 -05:00
Alasdair Nicol
911d9f4ed1
Fixed #27238 -- Disabled check_pattern_startswith_slash if settings.APPEND_SLASH=False.
...
Thanks strycore for the report and timgraham for suggesting the
solution.
2016-09-19 21:00:12 -04:00
Riccardo Magliocchetti
7ed8b98f42
Clarified URL regex check message with respect to include().
2016-09-01 14:06:45 -04:00
Adam Chainz
19e20a2a3f
Fixed crash comparing CheckMessage objects to non-CheckMessage objects.
2016-08-16 17:17:34 -04:00
Adam Chainz
68b580323b
Added tests for check Message equality.
2016-08-16 17:04:13 -04:00
Ed Morley
7399fee6c3
Refs #26947 -- Added a deployment system check for SECURE_HSTS_PRELOAD.
2016-08-10 20:31:01 -04:00
Tim Graham
c9ae09addf
Replaced use of TestCase.fail() with assertRaises().
...
Also removed try/except/fail antipattern that hides exceptions.
2016-06-28 11:21:26 -04:00
Jon Dufresne
4f336f6652
Fixed #26747 -- Used more specific assertions in the Django test suite.
2016-06-16 14:19:18 -04:00
Ville Skyttä
fa654da613
Removed usage of a few deprecated unittest assertions.
2016-06-14 09:03:12 -04:00
Tim Graham
354acd04af
Refs #26601 -- Added a warning if both MIDDLEWARE AND MIDDLEWARE_CLASSES are set.
2016-05-17 07:24:45 -04:00
Florian Apolloner
9baf692a58
Fixed #26601 -- Improved middleware per DEP 0005.
...
Thanks Tim Graham for polishing the patch, updating the tests, and
writing documentation. Thanks Carl Meyer for shepherding the DEP.
2016-05-17 07:22:22 -04:00
Alasdair Nicol
eb5d7bc2f4
Fixed #26440 -- Added a warning for non-url()s in urlpatterns.
...
Thanks Burhan Khalid for the initial patch and knbk/timgraham
for review.
2016-04-30 20:09:31 -04:00
Alasdair Nicol
ffb1c532ec
Added an explicit test that URL checks are recursive.
2016-04-29 07:38:57 -04:00
Claude Paroz
f9a2a7db17
Fixed #26351 -- Added MySQL check to warn about strict mode option
...
Thanks Adam Chainz for the initial implementation in django-mysql.
Thanks Adam Chainz, Tim Graham, and Shai Berger for the reviews.
2016-04-08 20:34:16 +02:00
Claude Paroz
0d3c616fbb
Refs #26351 -- Added check hook to support database-related checks
...
Thanks Tim Graham and Shai Berger for the reviews.
2016-04-08 20:28:00 +02:00
Vincenzo Pandolfo
abf07355aa
Fixed #26365 -- Added a system check to ensure "string_is_invalid" is a string.
2016-03-21 13:01:38 -04:00
Tim Graham
004ba0f99e
Removed unneeded hint=None/obj=None in system check messages.
2016-02-12 13:01:25 -05:00
Markus Holtermann
18afd50a2b
Updated allow_migrate() signature in check framework tests
2016-02-12 14:31:27 +11:00
Buddy Lindsey, Jr
731bdfe68a
Fixed #26155 -- Skipped URL checks if no ROOTURL_CONF setting.
2016-02-01 13:51:38 -05:00
Hasan
3d0dcd7f5a
Refs #26022 -- Used context manager version of assertRaises in tests.
2016-01-29 12:32:18 -05:00
Simon Charette
a08fda2111
Fixed #25746 -- Isolated inlined test models registration.
...
Thanks to Tim for the review.
2016-01-06 20:00:07 -05:00
Josh Soref
93452a70e8
Fixed many spelling mistakes in code, comments, and docs.
2015-12-03 12:48:24 -05:00
Jon Dufresne
2875325889
Fixed #25500 -- Added --fail-level option to check command.
...
This option specifies the level that check command exits with a
non-zero status. Default is ``ERROR``.
2015-10-05 17:11:40 -04:00
Alasdair Nicol
f2975c021d
Refs #23813 -- Moved URLconfs into module and tidied docstrings.
2015-09-21 20:10:33 -04:00
Alasdair Nicol
fe3fc5210f
Fixed #23813 -- Added checks for common URL pattern errors
...
Thanks jwa and lamby for the suggestions, and timgraham and jarshwah
for their reviews.
2015-09-21 23:46:21 +10:00
Alasdair Nicol
15ce1a735c
Used more specific assertion in check_framework tests.
2015-09-19 18:35:05 -04:00
Tom Christie
b02f08e02c
Fixed #25034 -- Converted caches ImproperlyConfigured error to a system check.
2015-09-18 07:44:39 -04:00
Tim Graham
01b2b0b654
Fixed #25318 -- Made SILENCED_SYSTEM_CHECKS suppress all messages.
...
Previously, messages of ERROR level or higher were printed to
the console.
2015-08-28 13:34:56 -04:00
Ion Scerbatiuc
0cc059cd10
Fixed #25172 -- Fixed check framework to work with multiple databases.
2015-08-12 18:00:26 -04:00
Flavio Curella
c2e70f0265
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
2015-07-27 18:28:13 -04:00
rroskam
ed514caed2
Fixed #24966 -- Added deployment system check for empty ALLOWED_HOSTS.
2015-07-15 09:18:58 -04:00
Daniel Roseman
24620d71f2
Fixed #25079 -- Added warning if both TEMPLATES and TEMPLATE_* settings are defined.
...
Django ignores the value of the TEMPLATE_* settings if TEMPLATES is also
set, which is confusing for users following older tutorials. This change
adds a system check that warns if any of the TEMPLATE_* settings have
changed from their defaults but the TEMPLATES dict is also non-empty.
Removed the TEMPLATE_DIRS from the test settings file; this was marked
for removal in 1.10 but no tests fail if it is removed now.
2015-07-13 17:50:22 -04:00
Tim Graham
c19bc2d5d4
Fixed tests from refs #24922 when run in reverse.
2015-06-08 08:15:41 -04:00
Sergei Maertens
eaf4d8c0d8
Fixed #24922 -- Added system check for templates setting
...
If `'loaders'` is present in the `TEMPLATES` options together with
`APP_DIRS` set to `True`, the template engine raises an exception. This
conflict is now detected by the system check templates.E001.
2015-06-06 19:40:26 -04:00
Simon Charette
be67400b47
Refs #24652 -- Used SimpleTestCase where appropriate.
2015-05-20 13:46:13 -04:00
Tim Graham
c970018f41
Removed Django 1.7 MIDDLEWARE_CLASSES upgrade check.
2015-02-09 19:16:07 -05:00
Tim Graham
0ed7d15563
Sorted imports with isort; refs #23860 .
2015-02-06 08:16:28 -05:00
darkryder
9ec8aa5e5d
Fixed #24149 -- Normalized tuple settings to lists.
2015-02-03 14:59:45 -05:00
Tim Graham
789baf9c3a
Fixed test failures introduced in refs #23861 .
2015-01-05 14:35:30 -05:00
Tim Graham
c87ee41954
Fixed #23861 -- Added an API to deprecate model fields.
...
Thanks Markus Holterman and Berker Peksag for review.
2015-01-05 11:35:36 -05:00
Diego Guimarães
f39b0421b4
Fixed #23338 -- Added warning when unique=True on ForeigKey
...
Thanks Jonathan Lindén for the initial patch, and Tim Graham
and Gabe Jackson for the suggestions.
2014-11-27 19:42:30 -05:00
Tim Graham
c24a2e6cbd
Fixed #23765 -- Removed BooleanField default check which often yielded false positives.
2014-11-13 20:12:29 +01:00
averybigant
b7a5b6ab86
Fixed #23750 -- Allowed core.checks.register to be used as a function
2014-11-11 16:29:32 +01:00
Tim Graham
7ae03204ac
Fixed #23469 -- Removed test runner compatibility check which often yielded false positives.
2014-10-17 10:31:49 -04:00
Rigel Di Scala
a5c77417a6
Fixed #23615 -- Validate that a Model instance's "check" attribute is a method.
...
The "check" name is a reserved word used by Django's check framework,
and cannot be redefined as something else other than a method, or the check
framework will raise an error.
This change amends the django.core.checks.model_check.check_all_models()
function, so that it verifies that a model instance's attribute "check"
is actually a method. This new check is assigned the id "models.E020".
2014-10-16 23:49:21 +07:00
Loic Bistuer
157f9cf240
Minor cleanup in the check_framework test package.
2014-10-16 23:49:21 +07:00
Tim Graham
52ef6a4726
Fixed #17101 -- Integrated django-secure and added check --deploy option
...
Thanks Carl Meyer for django-secure and for reviewing.
Thanks also to Zach Borboa, Erik Romijn, Collin Anderson, and
Jorge Carleitao for reviews.
2014-09-12 15:05:23 -04:00
Tim Graham
add78c58b5
Added spaces to message from 4c39c270af
.
2014-06-30 07:39:35 -04:00
mlavin
4696cd9671
Fixed #22477 -- Removed contrib middleware from the global settings defaults.
...
Also added a compatibility check for changed middleware defaults.
Forwardport of d94de802d3
from stable/1.7.x
2014-06-13 12:45:56 -04:00
Simon Charette
9bc377d7d0
Fixed a test failure introduced by 214d1e1b0f
.
2014-04-18 02:30:40 -04:00
Tim Graham
395d75ea6b
Fixed #22194 -- Added --list-tags option to check command.
...
Thanks Elvard for the patch.
2014-04-10 09:43:55 -04:00
Russell Keith-Magee
6b63742ce5
Corrected expected test output to allow for cleanups in signal and compatibility checks.
2014-03-03 19:29:50 +08:00
Tim Graham
2b6914049a
Fixed #21849 -- Included the count of silenced system checks in output.
2014-01-28 08:31:02 -05:00
Carl Meyer
fb862c875e
Fix a check_framework test so it doesn't fail when TEST_RUNNER is set (e.g. on CI).
2014-01-20 21:08:02 -07:00
Russell Keith-Magee
d818e0c9b2
Fixed #16905 -- Added extensible checks (nee validation) framework
...
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-20 10:45:21 +08:00