summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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-09-16Fixed #31558 -- Added support for boolean attribute on properties in ↵Ryanwalker277
ModelAdmin.list_display.
2023-09-16Fixed #34842 -- Fixed ModelAdmin.readonly_fields crash with GeneratedFields.Paolo Melchiorre
2023-09-15Fixed #34832 -- Made admin's header content render in <header> tag.Sarah Abderemane
Header tag was changed to <header> get the landmark banner for accessibility.
2023-09-14Fixed #34838 -- Corrected output_field of resolved columns for GeneratedFields.Paolo Melchiorre
Thanks Simon Charette for the implementation idea.
2023-09-14Fixed #34834 -- Added role="search" to the admin changelist search form.Lemuel Sta Ana
2023-09-14Fixed #24561 -- Added support for callables on model fields' choices.Natalia
2023-09-14Fixed #34833 -- Made admin's main content render in <main> tag.Sarah Abderemane
2023-09-13Fixed #34822 -- Added support for serializing functions decorated with ↵Nick Pope
functools.lru_cache in migrations. `@functools.cache` and `@functools.lru_cache` return an object of type `functools._lru_cache_wrapper` which prevented the migrations serializer from working. Simply using the existing `FunctionTypeSerializer` for this additional type works as expected.
2023-09-13Refs #34822 -- Added tests for serializing decorated functions in migrations.Nick Pope
Functions decorated with a decorator that is properly wrapped, e.g. by using `@functools.wraps`, are already supported.
2023-09-13Corrected logger in ↵Mariusz Felisiak
CsrfViewMiddlewareTestMixin.test_ensures_csrf_cookie_no_logging(). Logger was changed in 55fec16aafed30a9daa06d6ecdf8ca3ad361279e.
2023-09-13Refs #31949 -- Made make_middleware_decorator to work with async functions.Ben Lomax
2023-09-13Added more tests for decorators.Ben Lomax
2023-09-13Modernized enumeration helpers on Python 3.11+.Nick Pope
- use @enum.property https://docs.python.org/3/library/enum.html#enum.property - use @enum.nonmember Using @property on an enum class does not yield the expected result. do_not_call_in_templates attribute works because a @property instance is truthy. We can make this a literal True value as expected by using @enum.nonmember in Python 3.11+. https://docs.python.org/3/library/enum.html#enum.nonmember - used enum.IntEnum/StrEnum Python 3.11+ has ReprEnum which uses int.__str__() and str.__str__() for __str__() in the `IntEnum` and `StrEnum` subclasses. We can emulate that for Python < 3.11. https://docs.python.org/3/library/enum.html#enum.ReprEnum https://docs.python.org/3/library/enum.html#enum.IntEnum https://docs.python.org/3/library/enum.html#enum.StrEnum
2023-09-12Renamed ChoicesMeta to ChoicesType.Nick Pope
This also uses enum.EnumType for Python 3.11+ as Python 3.11 renamed EnumMeta to EnumType. While the former is still available as an alias of the latter for now, let's prefer the canonical name for this. Check out https://docs.python.org/3/library/enum.html#enum.EnumType
2023-09-11Fixed #34752 -- Fixed handling ASGI http.disconnect for streaming responses.Sam Toyer
2023-09-11Fixed #34821 -- Prevented DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings ↵Mariusz Felisiak
from mutating the main STORAGES. Regression in 6b965c600054f970bdf94017ecf2e0e6e0a4326b.
2023-09-11Fixed #34824 -- Prevented unnecessary AlterField when ↵donghao
ForeignObject.from_fields/to_fields is not a tuple.
2023-09-11Fixed #34642 -- Added File.open() support for *args and **kwargs.Yves Weissig
2023-09-09Fixed #34820 -- Fixed migrations crash when changing a ForeignObject field.donghao
2023-09-08Fixed #34816 -- Fixed GenericForeignKey crash when checking cache for ↵Oguzhan Akan
primary keys with different types.
2023-09-07Fixed #34810 -- Measured test coverage on django-admin commands.Jacob Walls
2023-09-07Fixed #34791 -- Fixed incorrect Prefetch()'s cache for singly related objects.Maxime Toussaint
Changed the cache name used for singly related objects to be the to_attr parameter passed to a Prefetch object. This fixes issues with checking if values have already been fetched in cases where the Field already has some prefetched value, but not for the same model attr.
2023-09-07Fixed #31300 -- Added GeneratedField model field.Jeremy Nauta
Thanks Adam Johnson and Paolo Melchiorre for reviews. Co-Authored-By: Lily Foote <code@lilyf.org> Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-09-05Fixed #34730 -- Added ↵François Freitag
django.contrib.messages.test.MessagesTestMixin.assertMessages().
2023-09-04Refs #34233 -- Bumped minimum supported version of docutils to 0.19.Jacob Walls
2023-09-04Fixed CVE-2023-41164 -- Fixed potential DoS in ↵Mariusz Felisiak
django.utils.encoding.uri_to_iri(). Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report. Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
2023-09-01Fixed #34778 -- Avoided importing modules in startapp/startproject.Jacob Walls
2023-09-01Fixed #34768 -- Avoided initializing colorama on non-Windows platforms.Sulabh Katila
2023-09-01Fixed #34803 -- Fixed queryset crash when filtering againts deeply nested ↵willzhao
OuterRef annotations. Thanks Pierre-Nicolas Rigal for the report. Regression in c67ea79aa981ae82595d89f8018a41fcd842e7c9.
2023-08-31Refs #32355 -- Removed unnecessary getattr() call.Mariusz Felisiak
options.test_name_patterns is always defined. Follow up to ec0ff406311de88f4e2a135d784363424fe602aa.
2023-08-31Refs #34712 -- Added system check for staticfiles storage in STORAGES setting.Bruno Alla
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
2023-08-31Fixed #34210 -- Added unittest's durations option to the test runner.David Smith
2023-08-31Fixed #34547 -- Deprecated DatabaseOperations.field_cast_sql().David Smith
2023-08-30 Fixed #31262 -- Added support for mappings on model fields and ↵Nick Pope
ChoiceField's choices.
2023-08-30Fixed #34799 -- Made MySQL introspection skip cross-database relations.John Whitman
2023-08-30Fixed #34757 -- Added support for following redirects to AsyncClient.Olivier Tabone
2023-08-28Fixed #34787 -- Fixed autoreloader crash when run from installed script on ↵sarahboyce
Windows.
2023-08-25Fixed #34709 -- Raised BadRequest for non-UTF-8 requests with the ↵Mariusz Felisiak
application/x-www-form-urlencoded content type. Thanks Eki Xu for the report.
2023-08-25Refs #34730 -- Made Message importable from django.contrib.messages.François Freitag
2023-08-24Refs #24121 -- Added __repr__() to Message.François Freitag
2023-08-23Fixed #34744 -- Prevented recreation of migration for constraints with a ↵David Sanders
dict_keys. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-08-23Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.Mariusz Felisiak
- backends.sqlite.tests.ThreadSharing.test_database_sharing_in_threads - backends.tests.ThreadTests.test_default_connection_thread_local: on SQLite, close() doesn't explicitly close in-memory connections. - servers.tests.LiveServerInMemoryDatabaseLockTest - test_runner.tests.SQLiteInMemoryTestDbs.test_transaction_support Check out https://github.com/python/cpython/pull/108015.
2023-08-22Removed unnecessary trailing commas in tests.konsti
2023-08-22Added tests for model field's choices iterator/iterable values.Natalia
2023-08-21Fixed #33143 -- Raised RuntimeWarning when performing import-time queries.Florian Zimmermann
2023-08-20Fixed utils_tests.test_lazyobject.SimpleLazyObjectPickleTestCase.Mariusz Felisiak
SimpleLazyObjectPickleTestCase executes database queries so it must inherit from django.test.TestCase.
2023-08-19Fixed #34779 -- Avoided unnecessary selection of non-nullable m2m fields ↵Juan Alvarez
without natural keys during serialization. By using `select_related(None)` instead of `select_related()`, the unnecessary joins are completely avoided. Note that the current tests already covers the change, when the field is not `null=True`. Regression in f9936deed1ff13b20e18bd9ca2b0750b52706b6c.
2023-08-18Fixed #34773 -- Fixed syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE ↵Mariusz Felisiak
settings with STORAGES. Thanks Petr Dlouhý for the report. Bug in 32940d390a00a30a6409282d314d617667892841.
2023-08-11Fixed #34362 -- Fixed FilteredRelation() crash on conditional expressions.Francesco Panico
Thanks zhu for the report and Simon Charette for reviews.