summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
AgeCommit message (Collapse)Author
2026-02-25Fixed #36839 -- Warned when model renames encounter conflicts from stale ↵AbhimanyuGit2507
ContentTypes.
2026-02-21Fixed #36935 -- Added fallback in ContentType.app_labeled_name when ↵Marco Aurélio da Rosa Haubrich
model_class() is None. Updated ContentType.app_labeled_name to include the app_label in its string representation. This removed ambiguity for content types whose models were not present in the current codebase (for example, when multiple applications share the same database). Adjusted related tests to reflect the new representation.
2025-10-18Fixed #21961 -- Added support for database-level delete options for ForeignKey.Mariusz Felisiak
Thanks Simon Charette for pair programming. Co-authored-by: Nick Stefan <NickStefan12@gmail.com> Co-authored-by: Akash Kumar Sen <71623442+Akash-Kumar-Sen@users.noreply.github.com> Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-10-16Bumped minimum isort version to 7.0.0.Jacob Walls
Added ignores relating to https://github.com/PyCQA/isort/issues/2352.
2025-09-18Refs #28586 -- Split descriptor from GenericForeignKey.Adam Johnson
This makes GenericForeignKey more similar to other fields which act as descriptors, preparing it to add “fetcher protocol” support in a clear and consistent way.
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-04-02Fixed #36267 -- Fixed contenttypes shortcut() view crash with an invalid ↵Ahmed Nassar
object_id for a UUIDField pk.
2025-01-15Refs #33651 -- Removed Prefetch.get_current_queryset() and ↵Sarah Boyce
get_prefetch_queryset() per deprecation timeline.
2024-12-02Fixed #35950 -- Restored refreshing of relations when fields deferred.Adam Johnson
Thank you to Simon Charette and Sarah Boyce for the review. Regression in 73df8b54a2fab53bec4c7573cda5ad8c869c2fd8.
2024-08-28Fixed #35666 -- Documented stacklevel usage and testing, and adjusted test ↵Simon Charette
suite accordingly. Over the years we've had multiple instances of hit and misses when emitting warnings: either setting the wrong stacklevel or not setting it at all. This work adds assertions for the existing warnings that were declaring the correct stacklevel, but were lacking tests for it.
2024-06-24Fixed #35545, Refs #32833 -- Fixed ContentTypeManager.get_for_models() crash ↵Sarah Boyce
in CreateModel migrations. Thank you to Csirmaz Bendegúz for the report and Simon Charettes for the review.
2024-05-04Fixed #35426 -- Updated querysets to be a required argument of GenericPrefetch.sobolevn
2024-03-08Fixed #35044 -- Avoided clearing reverse relations and private fields when ↵Giannis Terzopoulos
accessing deferred fields. Regression in a7b5ad8b19a08d7d57302ece74f6e26d2887fd9f for reverse relations and possibly in 123b1d3fcf79f091573c40be6da7113a6ef35b62 for private fields.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-09-18Fixed #33651 -- Added support for prefetching GenericForeignKey.Clément Escolano
Co-authored-by: revanthgss <revanthgss@almabase.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-03-09Fixed #33985 -- Used app_config.verbose_name in ContentType.__str__().Hrushikesh Vaidya
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2022-11-07Fixed #34137 -- Made Model.refresh_from_db() clear cached generic relations.Bhuvnesh
Thanks Simon Charette for the implementation idea.
2022-10-11Completed test coverage for contenttypes models.Marcelo Galigniana
2022-10-10Fixed #32833 -- Fixed ContentTypeManager.get_for_models() crash when using ↵Sarah Boyce
in migrations. Co-authored-by: Heraldo Lucena <23155511+HMaker@users.noreply.github.com>
2022-04-18Fixed various tests on MySQL with MyISAM storage engine.Mariusz Felisiak
2022-03-15Fixed #31169 -- Adapted the parallel test runner to use spawn.David Smith
Co-authored-by: Valz <ahmadahussein0@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-03-14Fixed #31357 -- Fixed get_for_models() crash for stale content types when ↵Biel Frontera
model with the same name exists in another app.
2022-03-08Fixed #33563 -- Fixed contenttype reverse data migration crash with a ↵Hameed Gifford
multiple databases setup.
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-14Fixed #33008 -- Fixed prefetch_related() for deleted GenericForeignKeys.Martin Svoboda
Thanks Simon Charette for the implementation idea.
2020-09-14Fixed #31789 -- Added a new headers interface to HttpResponse.Tom Carrick
2020-05-15Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.Simon Charette
2020-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2020-03-19Fixed #31123 -- Added --include-stale-apps option to the ↵gowthamk63
remove_stale_contenttypes management command. Co-Authored-By: Javier Buzzi <buzzi.javier@gmail.com>
2019-06-06Fixed #29706 -- Made RenameContentType._rename() save to the correct database.Hasan Ramezani
2019-02-07Fixed #16027 -- Added app_label to ContentType.__str__().Gregory N. Schmit
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
2018-12-21Added tests for ContentType/Group/Permission.__str__().Tim Graham
2018-07-10Fixed #29556 -- Made 'remove_stale_contenttypes --noinput' delete content types.Jon Dufresne
2018-07-10Simplified a couple test docstrings.Tim Graham
2018-06-21Refs #18620 -- Refactored ContentTypes view tests to group related field ↵Paulo
test cases.
2018-06-21Fixed #18620 -- Made ContentTypes shortcut view prefer current site if ↵Paulo
available. Thanks Mike Tigas (mtigas) for the initial patch.
2018-06-21Added test for contenttype redirect with m2m objects.Paulo
Thanks carltongibson for the test logic.
2018-06-21Corrected location of some contenttypes_tests.Tim Graham
2018-02-02Fixed imports per isort 4.3.1.Tim Graham
Partially reverted 9bcf73d788866bc93f8248cb2e9d601ecbc4b50c.
2018-02-01Fixed imports per isort 4.3.0.Mariusz Felisiak
2017-06-26Fixed #28313 -- Added model name max length check of 100 characters in ↵michaldabski
contrib.contentttypes.
2017-06-16Fixed #26936 -- Fixed stale ContentType deletion in apps without models.Pavel Rybintsev
2017-05-24Refs #27804 -- Used subTest() in several tests.Bruno Alla
2017-02-10Added multi_db=True to test cases that access the 'other' db connection.Tim Graham
Fixed a failure in the context processors tests when running in reverse on MySQL due to an extra query after refs #27683.
2017-02-03Refs #27745 -- Improved test coverage of contrib.contenttypes.Anton Samarchyan