From d740bae95a30d473e9de0019bc31475900caa435 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Fri, 7 Jul 2017 12:47:08 -0400 Subject: [PATCH] Update json imports --- rest_framework/fields.py | 3 +-- rest_framework/parsers.py | 2 +- rest_framework/renderers.py | 3 +-- rest_framework/utils/serializer_helpers.py | 2 +- tests/test_renderers.py | 2 +- tests/test_routers.py | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 072bbf1b9..e17a0bf9a 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -5,7 +5,6 @@ import copy import datetime import decimal import inspect -import json import re import uuid from collections import OrderedDict @@ -37,7 +36,7 @@ from rest_framework.compat import ( ) from rest_framework.exceptions import ErrorDetail, ValidationError from rest_framework.settings import api_settings -from rest_framework.utils import html, humanize_datetime, representation +from rest_framework.utils import html, humanize_datetime, json, representation class empty: diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 0e40e1a7a..5ebaeca2e 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -7,7 +7,6 @@ on the request, such as form content or json encoded data. from __future__ import unicode_literals import codecs -import json from django.conf import settings from django.core.files.uploadhandler import StopFutureHandlers @@ -23,6 +22,7 @@ from django.utils.six.moves.urllib import parse as urlparse from rest_framework import renderers from rest_framework.exceptions import ParseError +from rest_framework.utils import json class DataAndFiles(object): diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 687cb0e1e..a87eb1889 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -9,7 +9,6 @@ REST framework also provides an HTML renderer that renders the browsable API. from __future__ import unicode_literals import base64 -import json from collections import OrderedDict from django import forms @@ -30,7 +29,7 @@ from rest_framework.compat import ( from rest_framework.exceptions import ParseError from rest_framework.request import is_form_media_type, override_method from rest_framework.settings import api_settings -from rest_framework.utils import encoders +from rest_framework.utils import encoders, json from rest_framework.utils.breadcrumbs import get_breadcrumbs from rest_framework.utils.field_mapping import ClassLookupDict diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework/utils/serializer_helpers.py index d1bba9666..da89d08ff 100644 --- a/rest_framework/utils/serializer_helpers.py +++ b/rest_framework/utils/serializer_helpers.py @@ -1,12 +1,12 @@ from __future__ import unicode_literals import collections -import json from collections import OrderedDict from django.utils.encoding import force_text from rest_framework.compat import unicode_to_repr +from rest_framework.utils import json class ReturnDict(OrderedDict): diff --git a/tests/test_renderers.py b/tests/test_renderers.py index 1625b0b70..ccc910c63 100644 --- a/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -import json import re from collections import MutableMapping, OrderedDict @@ -24,6 +23,7 @@ from rest_framework.request import Request from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework.test import APIRequestFactory +from rest_framework.utils import json from rest_framework.views import APIView DUMMYSTATUS = status.HTTP_200_OK diff --git a/tests/test_routers.py b/tests/test_routers.py index fee39b2b3..cbc7c0554 100644 --- a/tests/test_routers.py +++ b/tests/test_routers.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import json from collections import namedtuple import pytest @@ -15,6 +14,7 @@ from rest_framework.decorators import detail_route, list_route from rest_framework.response import Response from rest_framework.routers import DefaultRouter, SimpleRouter from rest_framework.test import APIRequestFactory +from rest_framework.utils import json factory = APIRequestFactory()