django/tests/utils_tests
Rob Hudson d63241ebc7 Fixed #15727 -- Added Content Security Policy (CSP) support.
This initial work adds a pair of settings to configure specific CSP
directives for enforcing or reporting policy violations, a new
`django.middleware.csp.ContentSecurityPolicyMiddleware` to apply the
appropriate headers to responses, and a context processor to support CSP
nonces in templates for safely inlining assets.

Relevant documentation has been added for the 6.0 release notes,
security overview, a new how-to page, and a dedicated reference section.

Thanks to the multiple reviewers for their precise and valuable feedback.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-06-27 15:57:02 -03:00
..
archives
eggs
files Rewrote strip_tags test file to lorem ipsum. 2022-03-08 14:50:06 +01:00
test_module Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
traversal_archives Fixed CVE-2021-3281 -- Fixed potential directory-traversal via archive.extract(). 2021-02-01 09:07:36 +01:00
__init__.py
deconstructible_classes.py Refs #21275 -- Added more tests for @deconstructible decorator. 2022-01-04 13:08:36 +01:00
models.py
test_archive.py Used addCleanup() in tests where appropriate. 2023-12-31 10:01:31 +01:00
test_autoreload.py Used addCleanup() in tests where appropriate. 2023-12-31 10:01:31 +01:00
test_choices.py Refs #34899 -- Extracted Field.flatchoices to flatten_choices helper function. 2023-10-23 13:44:23 -03:00
test_connection.py Prevented initialization of unused database connections. 2022-03-17 07:40:57 +01:00
test_crypto.py Refs #33476 -- Applied Black's 2023 stable style. 2023-02-01 11:04:38 +01:00
test_csp.py Fixed #15727 -- Added Content Security Policy (CSP) support. 2025-06-27 15:57:02 -03:00
test_datastructures.py Applied Black's 2024 stable style. 2024-01-26 12:45:07 +01:00
test_dateformat.py Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
test_dateparse.py Fixed #36005 -- Dropped support for Python 3.10 and 3.11. 2025-01-20 14:07:28 +01:00
test_deconstruct.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_decorators.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_duration.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_encoding.py Refs #34986 -- Fixed some test assertions for PyPy. 2023-11-28 06:19:38 +01:00
test_feedgenerator.py Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
test_functional.py Fixed #36005 -- Dropped support for Python 3.10 and 3.11. 2025-01-20 14:07:28 +01:00
test_hashable.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_html.py Fixed CVE-2025-32873 -- Mitigated potential DoS in strip_tags(). 2025-05-06 22:21:42 -03:00
test_http.py Fixed CVE-2025-27556 -- Mitigated potential DoS in url_has_allowed_host_and_scheme() on Windows. 2025-04-02 10:21:33 +02:00
test_inspect.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_ipv6.py Fixed #36098 -- Fixed validate_ipv6_address()/validate_ipv46_address() crash for non-string values. 2025-01-15 13:46:06 -03:00
test_lazyobject.py Fixed utils_tests.test_lazyobject.SimpleLazyObjectPickleTestCase. 2023-08-20 16:09:07 +02:00
test_lorem_ipsum.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_module_loading.py Fixed #34233 -- Dropped support for Python 3.8 and 3.9. 2023-01-18 09:46:01 +01:00
test_no_submodule.py
test_numberformat.py Refs #34000 -- Optimized handling None values in numberformat.format(). 2022-09-12 13:02:50 +02:00
test_os_utils.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_regex_helper.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_safestring.py Fixed #35648 -- Raised NotImplementedError in SafeString.__add__ for non-string RHS. 2024-08-12 14:25:05 -03:00
test_simplelazyobject.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_termcolors.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
test_text.py Applied Black's 2025 stable style. 2025-03-01 19:41:37 +01:00
test_timesince.py Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
test_timezone.py Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. 2025-02-18 08:35:36 +01:00
test_tree.py Refs #32948 -- Renamed Node._new_instance() to Node.create(). 2022-07-27 10:06:24 +02:00
utils.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00