summaryrefslogtreecommitdiff
path: root/tests/utils_tests
Commit message (Collapse)AuthorAgeFilesLines
* Refs #34483 -- Fixed timesince()/timeuntil() with timezone-aware dates on ↵Mariusz Felisiak2023-04-141-0/+18
| | | | | | different days and interval less than 1 day. Follow up to 813015d67e2557fa859a07930a9becec4e5f64a0. Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8.
* Fixed #34483 -- Fixed timesince()/timeuntil() with timezone-aware dates and ↵nessita2023-04-131-0/+17
| | | | | | | interval less than 1 day. Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8. Thanks Lorenzo Peña for the report.
* Fixed #34445 -- Fixed string-casting of non-string lazy objects.Ran Benita2023-03-301-0/+4
| | | | | | | | This removes __text_cast() as it's the same as __cast(). _delegate_bytes and __delegate_text are mutually exclusive so the `if self._delegate_bytes` branch in __cast() is unreachable. Co-Authored-By: David Sanders <shang.xiao.sanders@gmail.com>
* Completed test coverage for django.utils.datastructures.Marcelo Galigniana2023-02-151-0/+5
|
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-1/+0
| | | | | | | | 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
* Fixed #32528 -- Replaced django.utils.topological_sort with ↵Nick Pope2023-01-191-30/+0
| | | | | | graphlib.TopologicalSort(). graphlib.TopologicalSort() is available since Python 3.9.
* Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak2023-01-183-39/+7
|
* Refs #30127 -- Removed name argument for ↵Mariusz Felisiak2023-01-171-26/+0
| | | | | | django.utils.functional.cached_property(). Per deprecation timeline.
* Refs #32365 -- Removed is_dst argument for various methods and functions.Mariusz Felisiak2023-01-171-12/+0
| | | | Per deprecation timeline.
* Refs #32365 -- Removed support for pytz timezones per deprecation timeline.Mariusz Felisiak2023-01-172-107/+6
|
* Refs #32738 -- Removed django.utils.datetime_safe module per deprecation ↵Mariusz Felisiak2023-01-171-77/+0
| | | | timeline.
* Refs #32712 -- Removed django.utils.baseconv module per deprecation timeline.Mariusz Felisiak2023-01-171-60/+0
|
* Fixed #34243 -- Fixed timesince() crash with timezone-aware dates and ↵sag᠎e2023-01-051-2/+10
| | | | | interval longer than 1 month. Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8.
* Added support for datetime.date to DateFormat.r().Nick Pope2023-01-051-1/+9
|
* Fixed #33879 -- Improved timesince handling of long intervals.GianpaoloBranca2023-01-041-2/+33
|
* Fixed #34194 -- Added django.utils.http.content_disposition_header().Alex Vandiver2022-12-051-0/+26
|
* Updated documentation and comments for RFC updates.Nick Pope2022-11-102-2/+2
| | | | | | | | | | | | | | | - Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
* Refs #34000 -- Optimized handling None values in numberformat.format().Jimmy Angelakos2022-09-121-0/+1
|
* Fixed #34000 -- Fixed numberformat.format() crash on empty strings.Jimmy Angelakos2022-09-121-0/+3
|
* Refs #30213 -- Removed post-startup check for Watchman availability.Carlton Gibson2022-08-111-10/+0
| | | | | This is checked at startup in get_reloader(). The runtime check ties the implementation to Watchman excessively.
* Refs #32948 -- Renamed Node._new_instance() to Node.create().Nick Pope2022-07-271-2/+2
| | | | | | | | | | | | | | | | | | | 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.
* Refs #32948 -- Added more tests for django.utils.tree.Node.Nick Pope2022-07-271-4/+38
| | | | | | | 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.
* Used AND, OR, XOR constants instead of hard-coded values.Nick Pope2022-07-271-3/+4
|
* Updated vendored _urlsplit() to strip newline and tabs.Michael Manfre2022-07-011-0/+1
| | | | | | 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.
* Fixed #33779 -- Allowed customizing encoder class in ↵Hrushikesh Vaidya2022-06-281-0/+11
| | | | django.utils.html.json_script().
* Refs #33697 -- Used django.utils.http.parse_header_parameters() for parsing ↵Mehrdad2022-06-281-0/+38
| | | | | | | boundary streams. This also removes unused parse_header() and _parse_header_params() helpers in django.http.multipartparser.
* Refs #33173 -- Removed use of deprecated cgi module.Carlton Gibson2022-05-111-0/+37
| | | | https://peps.python.org/pep-0594/#cgi
* Refs #33173 -- Fixed test_dateparse tests on Python 3.11+.Mariusz Felisiak2022-05-091-2/+7
| | | | date/datetime/time.fromisoformat() support any valid ISO 8601 format in Python 3.11+, see https://github.com/python/cpython/issues/80010.
* Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson2022-03-242-11/+9
| | | | | Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
* Prevented initialization of unused database connections.Florian Apolloner2022-03-171-0/+4
|
* Rewrote strip_tags test file to lorem ipsum.Adam Johnson2022-03-083-104/+25
|
* Refs #33173 -- Used locale.getlocale() instead of getdefaultlocale().Mariusz Felisiak2022-03-081-1/+1
| | | | locale.getdefaultlocale() was deprecated in Python 3.11, see https://bugs.python.org/issue46659.
* Fixed #20296 -- Prevented mark_safe() from evaluating lazy objects.Theo Alexiou2022-02-211-5/+13
|
* Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().Matthias Kestenholz2022-02-171-0/+8
| | | | | | | Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
* Fixed #28358 -- Prevented LazyObject from mimicking nonexistent attributes.Theo Alexiou2022-02-161-0/+22
| | | | Thanks Sergey Fedoseev for the initial patch.
* Fixed #26287 -- Added support for addition operations to SimpleLazyObject.Theo Alexiou2022-02-101-0/+11
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-075-21/+36
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-0741-1855/+2638
|
* Fixed #33465 -- Added empty __slots__ to SafeString and SafeData.Keryn Knight2022-01-291-1/+13
| | | | | | | | | | 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.
* Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering2022-01-071-0/+7
|
* Refs #33216 -- Made @deconstructible do not change path for subclasses.Allen Jonathan David2022-01-041-0/+28
|
* Refs #21275 -- Added more tests for @deconstructible decorator.Allen Jonathan David2022-01-042-0/+69
|
* Fixed #33368 -- Fixed parse_duration() crash on invalid separators for ↵mendespedro2021-12-201-0/+5
| | | | decimal fractions.
* Fixed #30127 -- Deprecated name argument of cached_property().mgaligniana2021-12-161-7/+27
|
* Fixed unescape_string_literal() crash on empty strings.Florian Apolloner2021-12-141-1/+1
|
* Added test for ValueErrors in unescape_string_literal().Florian Apolloner2021-12-141-0/+7
|
* Updated various links to HTTPS and new locations.Mariusz Felisiak2021-12-021-1/+1
| | | | Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
* Fixed #33302 -- Made element_id optional argument for json_script template ↵Baptiste Mispelon2021-11-221-0/+6
| | | | | | filter. Added versionchanged note in documentation
* Fixed #33027 -- Made autoreloader pass -X options.Chenyang Yan2021-09-291-0/+16
|
* Refs #32074 -- Fixed find_module()/find_loader() warnings on Python 3.10+.Mariusz Felisiak2021-09-161-18/+25
|