Skip to content

Commit 0da26b5

Browse files
authored
Use json instead of simplejson (#44)
* Use `json` instead of `simplejson` * Fix linting issues
1 parent 8e3cffa commit 0da26b5

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

ariadne_django/scalars/json.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import json
12
from typing import Any
23

34
from ariadne import ScalarType
45

5-
import simplejson as json # supports decimals, etc.
6-
76

87
json_scalar = ScalarType("JSON")
98

ariadne_django/tests/graphql_query_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import json
12
from typing import IO, Any, Dict, List, Optional, Tuple
23

34
from django.http import HttpResponse
45
from django.test import Client, TestCase
56

6-
import simplejson as json
7-
87

98
class BaseGraphQLQueryTest(TestCase):
109
@staticmethod

ariadne_django/views/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"settings": {
2727
"request.credentials": "same-origin",
2828
},
29-
3029
# Request HTTP headers added by default
3130
"headers": {},
3231
}
3332

33+
3434
class BaseGraphQLView(TemplateResponseMixin, ContextMixin, View):
3535
http_method_names = ["get", "post", "options"]
3636
template_name = "ariadne_django/graphql_playground.html"

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
ariadne>=0.13.0,<0.13.99
22
django>=2.2
33
python-dateutil==2.8.1
4-
simplejson==3.17.2

tests/test_scalars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# pylint: disable=comparison-with-callable,protected-access
22
import uuid
33
from decimal import Decimal, InvalidOperation
4+
from json import JSONDecodeError
45

56
from django.utils import timezone
67

78
import pytest
8-
from simplejson import JSONDecodeError
99

1010
from ariadne_django.scalars import (
1111
date_scalar,
@@ -27,7 +27,7 @@
2727
time_scalar,
2828
uuid_scalar,
2929
)
30-
from ariadne_django.scalars.timedelta import serialize_timedelta, parse_timedelta_value, timedelta_scalar
30+
from ariadne_django.scalars.timedelta import parse_timedelta_value, serialize_timedelta, timedelta_scalar
3131

3232

3333
@pytest.fixture

0 commit comments

Comments
 (0)