django/tests
Adam Johnson 6dc9b04018 Refs #28586 -- Copied fetch modes to related objects.
This change ensures that behavior and performance remain consistent when
traversing relationships.
2025-10-16 14:52:22 -04:00
..
absolute_url_overrides
admin_autodiscover
admin_changelist Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
admin_checks Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
admin_custom_urls Removed double spaces after periods and within phrases. 2025-07-23 10:09:43 -03:00
admin_default_site
admin_docs Captured stderr during admin_docs test. 2025-01-27 09:23:56 +01:00
admin_filters Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
admin_inlines Fixed #36601 -- Fixed color contrast of FilteredSelectMultiple widget chosen labels in TabularInlines. 2025-09-17 09:56:01 +02:00
admin_ordering Fixed #9602 -- Added AdminSite.get_model_admin(). 2023-07-07 08:06:01 +02:00
admin_registration Fixed #373 -- Added CompositePrimaryKey. 2024-11-29 11:23:04 +01:00
admin_scripts Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
admin_utils Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
admin_views Fixed #34041 -- Added aria-current attribute to admin breadcrumbs. 2025-10-14 08:10:43 -04:00
admin_widgets Fixed #34624 -- Removed change, delete, and view buttons for non-Select widgets in RelatedFieldWidgetWrapper. 2025-08-29 08:38:12 +02:00
aggregation Fixed CVE-2025-59681 -- Protected QuerySet.annotate(), alias(), aggregate(), and extra() against SQL injection in column aliases on MySQL/MariaDB. 2025-10-01 08:11:45 -04:00
aggregation_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
annotations Fixed CVE-2025-59681 -- Protected QuerySet.annotate(), alias(), aggregate(), and extra() against SQL injection in column aliases on MySQL/MariaDB. 2025-10-01 08:11:45 -04:00
app_loading Used addCleanup() in tests where appropriate. 2023-12-31 10:01:31 +01:00
apps Fixed #36369 -- Cleared additional cached properties in apps.clear_cache(). 2025-09-19 14:57:05 -04:00
asgi Fixed #36399 -- Added support for multiple Cookie headers in HTTP/2 for ASGIRequest. 2025-08-21 16:48:54 +02:00
async Refs #35530 -- Removed request.user or auser() fallback in auth.login and auth.alogin. 2025-09-17 15:17:05 -03:00
auth_tests Refs #31223 -- Added __class_getitem__() to SetPasswordMixin. 2025-10-14 08:13:52 -04:00
backends Fixed #36623 -- Dropped support for PostgreSQL 14 and PostGIS 3.1. 2025-10-03 17:12:57 -04:00
base
bash_completion Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
basic Fixed #28586 -- Added model field fetch modes. 2025-10-16 14:52:22 -04:00
builtin_server
bulk_create Fixed failing bulk_create test raising IntegrityError when run in reverse. 2025-08-21 12:25:57 -03:00
cache Fixed #36560 -- Prevented UpdateCacheMiddleware from caching responses with Cache-Control 'no-cache' or 'no-store'. 2025-08-21 16:48:36 +02:00
check_framework Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
composite_pk Refs #36648 -- Removed hardcoded pk in CompositePKAggregateTests. 2025-10-15 23:44:14 -04:00
conditional_processing
constraints Fixed #34871, #36518 -- Implemented unresolved lookups expression replacement. 2025-08-04 09:22:53 +02:00
contenttypes_tests Refs #28586 -- Split descriptor from GenericForeignKey. 2025-09-18 19:44:16 -04:00
context_processors Fixed #15727 -- Added Content Security Policy (CSP) support. 2025-06-27 15:57:02 -03:00
csrf_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
custom_columns
custom_lookups Fixed #35972 -- Fixed lookup crashes after subquery annotations. 2025-08-04 10:14:01 +02:00
custom_managers Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
custom_methods
custom_migration_operations Fixed #35175 -- Made migraton writer preserve keyword-only arguments. 2024-02-09 09:37:13 +01:00
custom_pk Refs #10785 -- Added missing __hash__() method to custom pk test model. 2025-06-09 18:32:55 +02:00
datatypes Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
dates
datetimes
db_functions Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
db_typecasts
db_utils Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
dbshell Fixed #18392 -- Changed default mysql encoding to "utf8mb4". 2024-11-18 15:00:33 +01:00
decorators Fixed #36532 -- Added Content Security Policy view decorators to override or disable policies. 2025-08-28 17:23:48 -03:00
defer Fixed #28586 -- Added model field fetch modes. 2025-10-16 14:52:22 -04:00
defer_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
delete Fixed #36264 -- Excluded proxy neighbors of parents from deletion collection when keep_parents=True. 2025-09-23 16:40:57 +02:00
delete_regress Fixed #35073 -- Avoided unnecessary calling of callables used by SET/SET_DEFAULT in Collector.collect(). 2024-02-08 18:41:32 +01:00
deprecation Added cleanup of cache clearing to DjangoFilePrefixesTests.setUp(). 2025-09-19 09:49:03 +02:00
dispatch Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
distinct_on_fields Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
empty
empty_models
expressions Fixed CVE-2025-59681 -- Protected QuerySet.annotate(), alias(), aggregate(), and extra() against SQL injection in column aliases on MySQL/MariaDB. 2025-10-01 08:11:45 -04:00
expressions_case
expressions_window Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
extra_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
field_deconstruction Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
field_defaults Fixed #27222 -- Refreshed model field values assigned expressions on save(). 2025-09-14 00:27:50 +02:00
field_subclassing
file_storage Fixed 36622 -- Prevented LazyObject FileField storages from evaluating at boot time. 2025-10-15 18:25:08 -03:00
file_uploads Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
files Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
filtered_relation Fixed #36442 -- Cloned FilteredRelation before rename_prefix_from_q. 2025-06-12 08:36:54 +02:00
fixtures Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
fixtures_model_package
fixtures_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
flatpages_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
force_insert_update Fixed #33579 -- Specialized exception raised on forced update failures. 2025-03-10 21:09:15 +01:00
foreign_object Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
forms_tests Fixed #35892 -- Supported Widget.use_fieldset in admin forms. 2025-08-19 16:35:56 +02:00
from_db_value
generic_inline_admin Refs #34380 -- Changed the URLField default scheme to https and removed FORMS_URLFIELD_ASSUME_HTTPS per deprecation timeline. 2025-01-15 22:28:37 +01:00
generic_relations Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
generic_relations_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
generic_views Fixed #36488 -- Fixed merging of query strings in RedirectView. 2025-09-22 08:54:08 +02:00
get_earliest_or_latest Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
get_object_or_404
get_or_create Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
gis_tests Skipped GISFunctionsTests.test_geometry_type() test for MultiPoint on MariaDB and GEOS 3.12+. 2025-10-15 15:03:07 +02:00
handlers Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
httpwrappers Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
humanize_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
i18n Fixed #36543 -- Fixed time formats for fr_CA. 2025-09-23 16:52:47 +02:00
import_error_package
indexes Fixed #35469 -- Removed deferred SQL to create index removed by AlterField operation. 2024-05-28 12:44:07 +02:00
inline_formsets Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
inspectdb Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
introspection Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
invalid_models_tests Fixed #36611, Refs #36580 -- Added system check for multicolumn ForeignObject in Meta.indexes/constraints/unique_together. 2025-10-13 14:53:39 -03:00
known_related_objects
logging_tests Refs CVE-2025-48432 -- Made SuspiciousOperation logging use log_response() for consistency. 2025-06-06 09:05:32 -03:00
lookup Fixed #36614 -- Deprecated QuerySet.values_list(flat=True) without a field. 2025-09-30 08:46:28 +02:00
m2m_and_m2o Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
m2m_intermediary Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
m2m_multiple
m2m_recursive
m2m_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
m2m_signals
m2m_through Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
m2m_through_regress Fixed #36177 -- Added a trailing newline to JSON serializer. (#19232) 2025-03-11 08:01:06 +01:00
m2o_recursive
mail Fixed #35581 -- Updated django.core.mail to Python's modern email API. 2025-07-25 13:50:02 +02:00
managers_regress
many_to_many Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
many_to_one Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
many_to_one_null Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
max_lengths
messages_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
middleware Refs #34989 -- Ensured the Content-Length header is set when redirect with APPEND_SLASH. 2025-09-03 22:49:34 +02:00
middleware_exceptions
migrate_signals Removed double spaces after periods and within phrases. 2025-07-23 10:09:43 -03:00
migration_test_data_persistence Fixed #35921 -- Fixed failure when running tests in parallel on postgres. 2024-11-27 12:51:41 +01:00
migrations Fixed assertIndexExists() crash when non-index constraint exists on the same columns. 2025-09-29 23:01:12 +02:00
migrations2 Fixed #35122 -- Made migrate --prune option respect --app_label. 2024-02-13 14:47:49 +01:00
model_enums Fixed #36005 -- Dropped support for Python 3.10 and 3.11. 2025-01-20 14:07:28 +01:00
model_fields Removed reference to "manager" in ForeignKeyTests. 2025-10-13 16:12:44 -04:00
model_forms Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
model_formsets Fixed #36251 -- Avoided mutating form Meta.fields in BaseInlineFormSet. 2025-08-25 10:05:45 +02:00
model_formsets_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
model_indexes
model_inheritance Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
model_inheritance_regress Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
model_meta Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
model_options Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
model_package
model_regress
model_utils
modeladmin Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
multiple_database Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
mutually_referential
nested_foreign_keys Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
no_models
null_fk Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
null_fk_ordering Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
null_queries
one_to_one Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
or_lookups
order_with_respect_to Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
ordering Fixed #36407 -- Ensured default value is cast in Case expressions used in ORDER BY clause. 2025-06-05 09:52:56 +02:00
pagination Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
postgres_tests Refs #35444 -- Removed contrib.postgres aggregates ordering kwarg per deprecation timeline. 2025-09-17 15:17:05 -03:00
prefetch_related Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
project_template
properties
proxy_model_inheritance Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
proxy_models Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
queries Fixed CVE-2025-59681 -- Protected QuerySet.annotate(), alias(), aggregate(), and extra() against SQL injection in column aliases on MySQL/MariaDB. 2025-10-01 08:11:45 -04:00
queryset_pickle Refs #28586 -- Made fetch modes pickle as singletons. 2025-10-16 14:52:22 -04:00
raw_query Fixed #28586 -- Added model field fetch modes. 2025-10-16 14:52:22 -04:00
redirects_tests
requests_tests Refs #36520 -- Ensured only the header value is passed to parse_header_parameters for multipart requests. 2025-08-28 14:25:36 -03:00
requirements Bumped versions in pre-commit and npm configurations. 2025-09-22 17:25:19 +02:00
reserved_names
resolve_url
responses Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
reverse_lookup
save_delete_hooks Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
schema Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
select_for_update Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
select_related Refs #28586 -- Copied fetch modes to related objects. 2025-10-16 14:52:22 -04:00
select_related_onetoone Fixed #34612 -- Fixed QuerySet.only() crash on reverse relationships. 2023-06-01 19:50:47 +01:00
select_related_regress Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
serializers Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
servers Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
sessions_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
settings_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
shell Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches. 2025-07-18 08:47:44 -03:00
shortcuts Fixed #35784 -- Added support for preserving the HTTP request method in HttpResponseRedirectBase. 2024-11-14 15:53:49 -03:00
signals Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
signed_cookies_tests
signing Refs #33199 -- Removed support for passing positional arguments to Signer/TimestampSigner. 2023-09-18 22:12:40 +02:00
sitemaps_tests Americanized some spellings. 2025-04-16 10:21:38 +02:00
sites_framework
sites_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
sphinx Fixed #29942 -- Restored source file linking in docs by using the Sphinx linkcode ext. 2024-05-14 22:08:29 -03:00
staticfiles_tests Refs #22712 -- Removed all parameter from django.contrib.staticfiles.finders.find(). 2025-09-17 15:17:05 -03:00
str
string_lookup Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
swappable_models
syndication_tests Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
tasks Refs #35859 -- Removed support for Task enqueuing on transaction commit. 2025-09-17 13:28:58 -03:00
template_backends Fixed #35837 -- Added missing alters_data=True to QuerySet and UserManager methods. 2024-11-01 11:43:49 +01:00
template_loader
template_tests Refs #36559, #35667 -- Used skip_file_prefixes in PartialTemplate.source warning. 2025-09-04 12:14:10 -04:00
templates
test_client Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
test_client_regress Refs #36500 -- Corrected rewrapped long lines fixed via a script. 2025-07-23 20:17:55 -03:00
test_exceptions
test_runner Refs #36491 -- Skipped ParallelTestSuiteTest.test_buffer_mode_reports_setupclass_failure() without tblib. 2025-10-02 13:20:01 +02:00
test_runner_apps Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
test_utils Fixed #36589 -- Made assertTemplateUsed/NotUsed track full path for PartialTemplate. 2025-09-15 16:45:13 -04:00
timezones Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
transaction_hooks
transactions Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
unmanaged_models Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
update Fixed #35453 -- Made ManyToManyField.concrete False. 2025-09-22 09:52:22 -04:00
update_only_fields Fixed #27222 -- Refreshed model field values assigned expressions on save(). 2025-09-14 00:27:50 +02:00
urlpatterns Fixed #35518 -- Optimized RoutePattern by using string operations for converter-less routes. 2025-05-13 12:05:58 +01:00
urlpatterns_reverse Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
user_commands Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
utils_tests Fixed CVE-2025-59682 -- Fixed potential partial directory-traversal via archive.extract(). 2025-10-01 08:12:07 -04:00
validation Fixed #35638 -- Updated validate_constraints to consider db_default. 2024-08-05 17:33:12 +02:00
validators Fixed #36098 -- Fixed validate_ipv6_address()/validate_ipv46_address() crash for non-string values. 2025-01-15 13:46:06 -03:00
version
view_tests Refs #28526 -- Provided URLResolver namespace in technical 404 template. 2025-09-26 14:06:39 +02:00
wsgi Fixed #36467 -- Removed leading whitespaces from Set-Cookie header values in WSGIHandler. 2025-06-18 11:25:14 +02:00
xor_lookups Fixed #34604 -- Corrected fallback SQL for n-ary logical XOR. 2023-06-08 20:41:18 +02:00
.coveragerc Fixed #34810 -- Measured test coverage on django-admin commands. 2023-09-07 15:47:26 -03:00
README.rst
runtests.py Advanced deprecation warnings for Django 6.1. 2025-09-17 15:17:05 -03:00
sitecustomize.py Fixed #34810 -- Measured test coverage on django-admin commands. 2023-09-07 15:47:26 -03:00
test_sqlite.py Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
urls.py Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00

To run the test suite, first, create and activate a virtual environment. Then
install some requirements and run the tests::

    $ cd tests
    $ python -m pip install -e ..
    $ python -m pip install -r requirements/py3.txt
    $ ./runtests.py

For more information about the test suite, see
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/.