diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3cd989ff9..7d6c9f0f6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,24 +16,28 @@ jobs: fail-fast: false matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - django-version: ["3.2", "4.0", "4.1", "4.2"] # Todo: add "dev" back + django-version: ["3.2", "4.0", "4.1", "4.2", "dev"] # Todo: add "dev" back exclude: - python-version: "3.6" django-version: "4.0" - - python-version: "3.7" - django-version: "4.0" - python-version: "3.6" django-version: "4.1" - - python-version: "3.7" - django-version: "4.1" - python-version: "3.6" django-version: "4.2" + - python-version: "3.6" + django-version: "dev" + - python-version: "3.7" + django-version: "4.0" + - python-version: "3.7" + django-version: "4.1" - python-version: "3.7" django-version: "4.2" -# - python-version: "3.6" -# django-version: "dev" -# - python-version: "3.7" -# django-version: "dev" + - python-version: "3.7" + django-version: "dev" + - python-version: "3.8" + django-version: "dev" + - python-version: "3.9" + django-version: "dev" steps: - uses: actions/checkout@v2 @@ -60,6 +64,12 @@ jobs: - name: Test with Tox run: | tox -e py${{matrix.python-version}}-dj${{matrix.django-version}} + if: ${{matrix.django-version != 'dev'}} + - name: Test with Tox (Dev) + if: ${{matrix.django-version == 'dev'}} + run: | + tox -e py${{matrix.python-version}}-dj${{matrix.django-version}} + continue-on-error: true - name: Upload coverage data to coveralls.io run: coveralls --service=github continue-on-error: true diff --git a/tastypie/fields.py b/tastypie/fields.py index 5711f18a4..e51ff9968 100644 --- a/tastypie/fields.py +++ b/tastypie/fields.py @@ -12,7 +12,6 @@ except ImportError: from django.db.models.fields.related_descriptors import\ ReverseOneToOneDescriptor -from django.utils import datetime_safe from tastypie.bundle import Bundle from tastypie.exceptions import ApiFieldError, NotFound @@ -351,7 +350,7 @@ def convert(self, value): try: year, month, day = value[:10].split('-') - return datetime_safe.date(int(year), int(month), int(day)) + return datetime.date(int(year), int(month), int(day)) except ValueError: raise ApiFieldError("Date provided to '%s' field doesn't appear to be a valid date string: '%s'" % (self.instance_name, value)) @@ -389,7 +388,7 @@ def convert(self, value): year, month, day = value[:10].split('-') hour, minute, second = value[11:19].split(':') - return make_aware(datetime_safe.datetime(int(year), int(month), int(day), int(hour), int(minute), int(second))) + return make_aware(datetime.datetime(int(year), int(month), int(day), int(hour), int(minute), int(second))) except ValueError: raise ApiFieldError("Datetime provided to '%s' field doesn't appear to be a valid datetime string: '%s'" % (self.instance_name, value))