summaryrefslogtreecommitdiff
path: root/tests/utils_tests
AgeCommit message (Collapse)Author
2022-08-11Refs #30213 -- Removed post-startup check for Watchman availability.Carlton Gibson
This is checked at startup in get_reloader(). The runtime check ties the implementation to Watchman excessively.
2022-07-27Refs #32948 -- Renamed Node._new_instance() to Node.create().Nick Pope
Node._new_instance() was added in 6dd2b5468fa275d53aa60fdcaff8c28bdc5e9c25 to work around Q.__init__() having an incompatible signature with Node.__init__(). It was intended as a hook that could be overridden if subclasses needed to change the behaviour of instantiation of their specialised form of Node. In practice this doesn't ever seem to have been used for this purpose and there are very few calls to Node._new_instance() with other code, e.g. Node.__deepcopy__() calling Node and overriding __class__ as required. Rename this to Node.create() to make it a more "official" piece of private API that we can use to simplify a lot of other areas internally. The docstring and nearby comment have been reworded to read more clearly.
2022-07-27Refs #32948 -- Added more tests for django.utils.tree.Node.Nick Pope
The tests for creating new instances or copying instances of Node and its subclasses didn't fully capture the behaviour of the implementation, particularly around whether the `children` list or is contents were the same as the source.
2022-07-27Used AND, OR, XOR constants instead of hard-coded values.Nick Pope
2022-07-01Updated vendored _urlsplit() to strip newline and tabs.Michael Manfre
Refs Python CVE-2022-0391. Django is not affected, but others who incorrectly use internal function url_has_allowed_host_and_scheme() with unsanitized input could be at risk.
2022-06-28Fixed #33779 -- Allowed customizing encoder class in ↵Hrushikesh Vaidya
django.utils.html.json_script().
2022-06-28Refs #33697 -- Used django.utils.http.parse_header_parameters() for parsing ↵Mehrdad
boundary streams. This also removes unused parse_header() and _parse_header_params() helpers in django.http.multipartparser.
2022-05-11Refs #33173 -- Removed use of deprecated cgi module.Carlton Gibson
https://peps.python.org/pep-0594/#cgi
2022-05-09Refs #33173 -- Fixed test_dateparse tests on Python 3.11+.Mariusz Felisiak
date/datetime/time.fromisoformat() support any valid ISO 8601 format in Python 3.11+, see https://github.com/python/cpython/issues/80010.
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-03-17Prevented initialization of unused database connections.Florian Apolloner
2022-03-08Rewrote strip_tags test file to lorem ipsum.Adam Johnson
2022-03-08Refs #33173 -- Used locale.getlocale() instead of getdefaultlocale().Mariusz Felisiak
locale.getdefaultlocale() was deprecated in Python 3.11, see https://bugs.python.org/issue46659.
2022-02-21Fixed #20296 -- Prevented mark_safe() from evaluating lazy objects.Theo Alexiou
2022-02-17Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().Matthias Kestenholz
Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
2022-02-16Fixed #28358 -- Prevented LazyObject from mimicking nonexistent attributes.Theo Alexiou
Thanks Sergey Fedoseev for the initial patch.
2022-02-10Fixed #26287 -- Added support for addition operations to SimpleLazyObject.Theo Alexiou
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
2022-01-29Fixed #33465 -- Added empty __slots__ to SafeString and SafeData.Keryn Knight
Despite inheriting from the str type, every SafeString instance gains an empty __dict__ due to the normal, expected behaviour of type subclassing in Python. Adding __slots__ to SafeData is necessary, because otherwise inheriting from that (as SafeString does) will give it a __dict__ and negate the benefit added by modifying SafeString.
2022-01-07Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering
2022-01-04Refs #33216 -- Made @deconstructible do not change path for subclasses.Allen Jonathan David
2022-01-04Refs #21275 -- Added more tests for @deconstructible decorator.Allen Jonathan David
2021-12-20Fixed #33368 -- Fixed parse_duration() crash on invalid separators for ↵mendespedro
decimal fractions.
2021-12-16Fixed #30127 -- Deprecated name argument of cached_property().mgaligniana
2021-12-14Fixed unescape_string_literal() crash on empty strings.Florian Apolloner
2021-12-14Added test for ValueErrors in unescape_string_literal().Florian Apolloner
2021-12-02Updated various links to HTTPS and new locations.Mariusz Felisiak
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-11-22Fixed #33302 -- Made element_id optional argument for json_script template ↵Baptiste Mispelon
filter. Added versionchanged note in documentation
2021-09-29Fixed #33027 -- Made autoreloader pass -X options.Chenyang Yan
2021-09-16Refs #32074 -- Fixed find_module()/find_loader() warnings on Python 3.10+.Mariusz Felisiak
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-09-14Fixed #32873 -- Deprecated settings.USE_L10N.Claude Paroz
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-08-30Fixed #32992 -- Restored offset extraction for fixed offset timezones.Carlton Gibson
Regression in 10d126198434810529e0220b0c6896ed64ca0e88.
2021-08-19Fixed #32994 -- Fixed autoreloader tests when using 'python -m'.Jonny Park
2021-07-30Refs #32956 -- Updated words ending in -wards.David Smith
AP styleguide: Virtually none of the words ending with -wards end with an s.
2021-07-29Fixed 32956 -- Lowercased spelling of "web" and "web framework" where ↵David Smith
appropriate.
2021-07-23Fixed #32913 -- Made watchman reloader tests less flaky.Nick Pope
2021-07-13Completed test coverage for django.utils.dateformat.Nick Pope
2021-07-13Used subTest() in utils_tests.test_dateformat.Nick Pope
2021-07-07Fixed #32904 -- Made parse_time() more strict.abhiabhi94
Thanks Keryn Knight for the report.
2021-07-07Fixed #32866 -- Fixed trimming trailing punctuation from escaped string in ↵Shipeng Feng
urlize().
2021-07-06Added more tests for parse_time().Keryn Knight
2021-06-24Fixed #32727 -- Allowed spaces before time zone offset in parse_datetime().Ben Wilber
2021-06-07Fixed #32821 -- Updated os.scandir() uses to use a context manager.Chris Jerdonek
2021-05-26Fixed #32669 -- Fixed detection when started non-django modules which aren't ↵Moriyoshi Koizumi
packages with "python -m" in autoreloader.
2021-05-26Fixed #32783 -- Fixed crash of autoreloader when __main__ module doesn't ↵Mariusz Felisiak
have __spec__ attribute. Regression in ec6d2531c59466924b645f314ac33f54470d7ac3. Thanks JonathanNickelson for the report.
2021-05-13Fixed #32717 -- Fixed filtering of querysets combined with the | operator.Simon Charette
Address a long standing bug in a Where.add optimization to discard equal nodes that was surfaced by implementing equality for Lookup instances in bbf141bcdc31f1324048af9233583a523ac54c94. Thanks Shaheed Haque for the report.
2021-05-12Fixed #32738 -- Deprecated django.utils.datetime_safe module.Nick Pope
2021-05-12Refs #32738, Refs #29600, Refs #29595 -- Removed unused ↵Nick Pope
django.utils.datetime_safe.time(). Unused since c72dde41e603093ab0bb12fa24fa69cfda0d35f9.