Commit Graph

88 Commits

Author SHA1 Message Date
Tom Carrick bcc2befd0e Fixed #31789 -- Added a new headers interface to HttpResponse. 2020-09-14 08:41:59 +02:00
Simon Charette 94f63b926f Refs #31395 -- Relied on setUpTestData() test data isolation in various tests. 2020-05-15 20:22:56 +02:00
Mariusz Felisiak 555e3a848e
Removed unused __str__() methods in tests models.
Follow up to 6461583b6c.
2020-04-30 09:13:23 +02:00
gowthamk63 142ab6846a Fixed #31123 -- Added --include-stale-apps option to the remove_stale_contenttypes management command.
Co-Authored-By: Javier Buzzi <buzzi.javier@gmail.com>
2020-03-19 11:48:10 +01:00
Hasan Ramezani 661e6cc2c9 Fixed #29706 -- Made RenameContentType._rename() save to the correct database. 2019-06-06 12:09:01 +02:00
Gregory N. Schmit 48c17807a9 Fixed #16027 -- Added app_label to ContentType.__str__(). 2019-02-07 19:56:47 -05: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
Tim Graham 194a4b526c Added tests for ContentType/Group/Permission.__str__(). 2018-12-21 12:45:02 -05:00
Jon Dufresne 08ebed5e79 Fixed #29556 -- Made 'remove_stale_contenttypes --noinput' delete content types. 2018-07-10 10:14:34 -04:00
Tim Graham 178624855a Simplified a couple test docstrings. 2018-07-10 09:43:12 -04:00
Paulo fa679db1ff Refs #18620 -- Refactored ContentTypes view tests to group related field test cases. 2018-06-21 12:31:04 -04:00
Paulo d14850e525 Fixed #18620 -- Made ContentTypes shortcut view prefer current site if available.
Thanks Mike Tigas (mtigas) for the initial patch.
2018-06-21 12:31:04 -04:00
Paulo efbcd60a22 Added test for contenttype redirect with m2m objects.
Thanks carltongibson for the test logic.
2018-06-21 12:31:00 -04:00
Tim Graham b49ed4be47 Corrected location of some contenttypes_tests. 2018-06-21 12:26:28 -04:00
Tim Graham d0a42a14c0 Fixed imports per isort 4.3.1.
Partially reverted 9bcf73d788.
2018-02-02 14:44:07 -05:00
Mariusz Felisiak 9bcf73d788 Fixed imports per isort 4.3.0. 2018-02-01 09:29:46 +01:00
michaldabski d381914aef Fixed #28313 -- Added model name max length check of 100 characters in contrib.contentttypes. 2017-06-26 18:12:35 -04:00
Pavel Rybintsev 874b1f2cac Fixed #26936 -- Fixed stale ContentType deletion in apps without models. 2017-06-16 09:22:47 -04:00
Bruno Alla 6092ea8fa6 Refs #27804 -- Used subTest() in several tests. 2017-05-24 08:36:34 -04: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
Anton Samarchyan 4d6584000a Refs #27745 -- Improved test coverage of contrib.contenttypes. 2017-02-03 14:17:00 -05:00
Tim Graham aa14528910 Split up contenttypes_tests. 2017-02-03 13:58:59 -05:00
Tim Graham 29f607927f Fixed spelling of "nonexistent". 2017-02-03 08:01:45 -05:00
Claude Paroz fee42fd99e Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents
Thanks Tim Graham for the review.
2017-01-26 19:49:03 +01: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
Claude Paroz dc8834cad4 Refs #23919 -- Removed unneeded force_str calls 2017-01-20 08:44:31 +01: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 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz f3c43ad1fd Refs #23919 -- Removed python_2_unicode_compatible decorator usage 2017-01-18 13:44:34 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Simon Charette 4e48cfc108 Fixed #27709 -- Fixed get_for_models() for proxies with an empty cache.
Thanks Peter Inglesby for the report and tests.
2017-01-13 10:02:01 -05:00
Simon Charette dc1193085d Made contenttypes and auth apps unavailable when not necessary in tests. 2017-01-13 08:50:03 -05:00
Adam Chainz 334096dfac Simplified a contenttypes check test with mock. 2017-01-07 10:24:40 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Tim Graham 6a2af01452 Fixed #24865 -- Added remove_stale_contenttypes management command.
Thanks Simon Charette for the review.
2016-09-06 09:48:58 -04:00
Tim Graham e2dfa81ff7 Refs #18682 -- Edited explanation in stale content type deletion.
Follow up to 8db889eaf7.
2016-08-10 21:19:09 -04:00
Erik Romijn 8db889eaf7 Fixed #18682 -- Expanded explanation in stale content type deletion. (#6869) 2016-07-03 15:55:14 +02:00
Simon Charette 722344ee59
Refs #24067 -- Fixed contenttypes rename tests failures on Oracle.
Broke the initial migration in two to work around #25530 and added
'django.contrib.auth' to the available_apps to make sure its tables are also
flushed as Oracle doesn't implement cascade deletion in sql_flush().

Thanks Tim for the report.
2016-05-21 16:03:45 -04:00
Simon Charette f179113e6c
Fixed #24067 -- Renamed content types upon model renaming.
Thanks to Tim for the extensive review.
2016-05-17 12:14:58 -04:00
Simon Charette 61a16e0270 Fixed #24075 -- Used post-migration models in contrib apps receivers.
Thanks Markus and Tim for the review.
2016-05-15 19:51:16 -04:00
Tim Graham 2a9bcb503f Refs #26085, #11505 -- Cleared Site cache in contenttypes_tests. 2016-04-19 09:21:27 -04:00
dani poni d29d11b026 Fixed #26085 -- Fixed contenttypes shortcut() view crash with a null fk to Site.
Thanks Fabien Schwob for the initial patch.
2016-04-16 17:27:44 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Simon Charette 3938b3ccaa Fixed #26286 -- Prevented content type managers from sharing their cache.
This should prevent managers methods from returning content type instances
registered to foreign apps now that these managers are also attached to models
created during migration phases.

Thanks Tim for the review.

Refs #23822.
2016-02-26 16:18:16 -05:00
Tim Graham 004ba0f99e Removed unneeded hint=None/obj=None in system check messages. 2016-02-12 13:01:25 -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