Django-filter: Test failure on Django 3.1a1

Created on 14 May 2020  路  5Comments  路  Source: carltongibson/django-filter

There's a few changes in Django 3.1 around date times and ISO parsing.
https://docs.djangoproject.com/en/3.1/releases/3.1/

We've got one failure here:

======================================================================
287FAIL [0.002s]: test_clean (tests.test_fields.IsoDateTimeRangeFieldTests)
288----------------------------------------------------------------------
289Traceback (most recent call last):
290  File "/home/travis/build/carltongibson/django-filter/.tox/py37-latest/lib/python3.7/site-packages/django/test/utils.py", line 381, in inner
291    return func(*args, **kwargs)
292  File "/home/travis/build/carltongibson/django-filter/tests/test_fields.py", line 107, in test_clean
293    datetime(2015, 1, 10, 7, 45, 2, 345000)))
294AssertionError: slice[26 chars], 1, 10, 30, 1, 123000, tzinfo=datetime.timezo[167 chars]None) != slice[26 chars], 1, 9, 30, 1, 123000), datetime.datetime(2015[28 chars]None)
295
296----------------------------------------------------------------------

Most helpful comment

Yes. We鈥檙e working towards a new release. It would have been out already but for the pandemic.

Pip can install from GitHub if you want to test against master. (See the fox config here for inspiration.)

All 5 comments

Do you plan to make a new release when this failure is fixed? I'd like to test our project with Django 3.1a1 but one of the blockers in FieldDoesNotExist imported from a wrong place in django-filter 2.2 which seems to be already fixed in master. Thanks.

Yes. We鈥檙e working towards a new release. It would have been out already but for the pandemic.

Pip can install from GitHub if you want to test against master. (See the fox config here for inspiration.)

I think this might be a bug in Django 3.1 - not sure. https://github.com/django/django/pull/11893 enabled ISO 8601 formats for the builtin DateTimeField by leveraging parse_datetime. However, that result will have an attached UTC or fixed offset timezone, regardless of whether USE_TZ is disabled.

@rpkilby Quite possible. It鈥檚 on my list for Tuesday to verify this one way or another, but happy if you get there first. 馃榾

Was this page helpful?
0 / 5 - 0 ratings