diff --git a/rest_framework/compat.py b/rest_framework/compat.py index fcca2dcbf..e6039de5e 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -90,16 +90,6 @@ except ImportError: from django.db.models import get_model -# Import path changes from 1.7 onwards. -try: - from django.contrib.contenttypes.fields import ( - GenericForeignKey, GenericRelation - ) -except ImportError: - from django.contrib.contenttypes.generic import ( - GenericForeignKey, GenericRelation - ) - # django-filter is optional try: import django_filters diff --git a/tests/test_relations_generic.py b/tests/test_relations_generic.py index 5cb2dfc05..340d4d1d1 100644 --- a/tests/test_relations_generic.py +++ b/tests/test_relations_generic.py @@ -1,12 +1,14 @@ from __future__ import unicode_literals +from django.contrib.contenttypes.fields import ( + GenericForeignKey, GenericRelation +) from django.contrib.contenttypes.models import ContentType from django.db import models from django.test import TestCase from django.utils.encoding import python_2_unicode_compatible from rest_framework import serializers -from rest_framework.compat import GenericForeignKey, GenericRelation @python_2_unicode_compatible