From 3dcdc01cd1b509dcc8f056a65481ae6ce707b5c3 Mon Sep 17 00:00:00 2001 From: B4rtware <34386047+B4rtware@users.noreply.github.com> Date: Sat, 15 Feb 2020 13:51:11 +0100 Subject: [PATCH] improve backward compatibility by using date's class contructor instead of fromisostring --- graphene_django/rest_framework/tests/test_mutation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphene_django/rest_framework/tests/test_mutation.py b/graphene_django/rest_framework/tests/test_mutation.py index b9928a0..46d72ab 100644 --- a/graphene_django/rest_framework/tests/test_mutation.py +++ b/graphene_django/rest_framework/tests/test_mutation.py @@ -41,7 +41,7 @@ class MyModelSerializerWithMethod(serializers.ModelSerializer): fields = "__all__" def get_days_since_last_edit(self, obj): - now = datetime.date.fromisoformat("2020-01-08") + now = datetime.date(2020, 1, 8) return (now - obj.last_edited).days @@ -231,7 +231,7 @@ def test_perform_mutate_success(): mock_info(), **{ "cool_name": "Narf", - "last_edited": datetime.date.fromisoformat("2020-01-04"), + "last_edited": datetime.date(2020, 1, 4), } )