dealertrack / django-rest-framework-braces

Collection of utilities for working with django rest framework (DRF)
Other
73 stars 20 forks source link

Error with new django #29

Open MeggyCal opened 4 years ago

MeggyCal commented 4 years ago

Hi, while building with Django 3.1 I get the following error:

[   39s] FAIL: test_to_python_not_iso8601 (drf_braces.tests.forms.test_fields.TestISO8601DateTimeField)
[   39s] ----------------------------------------------------------------------
[   39s] Traceback (most recent call last):
[   39s]   File "/home/abuild/rpmbuild/BUILD/django-rest-framework-braces-0.3.4/drf_braces/tests/forms/test_fields.py", line 24, in test_to_python_not_iso8601
[   39s]     field.clean('2015-01-01T16:30')
[   39s] AssertionError: ValidationError not raised

It is clearly related to this change in Django 3.1:

django.forms.DateTimeField now accepts dates in a subset of ISO 8601 datetime formats, including optional timezone, e.g. 2019-10-10T06:47, 2019-10-10T06:47:23+04:00, or 2019-10-10T06:47:23Z. The timezone will always be retained if provided, with timezone-aware datetimes being returned even when USE_TZ is False.

I did not look at the rest of your code, so I do not know whether there are more incompatibilities or not.

Could you please at least try to support Django 3.1? Thanks a lot!