  from django.db import models
  from django.forms import widgets
  from django.utils import six
  from django.utils.datastructures import SortedDict
  from django.core.exceptions import ObjectDoesNotExist
  from rest_framework.settings import api_settings
  
  
  # Note: We do the following so that users of the framework can use this style:
  #
 
</s> remove     def test_exception_for_incorect_fk(self):
 </s> add     def test_exception_for_incorrect_fk(self): </s> remove         self.assertRaises(AssertionError, PersonSerializerInvalidReadOnly, [])
 </s> add         serializer = PersonSerializerInvalidReadOnly()
        with self.assertRaises(AssertionError):
            serializer.fields </s> remove             TestSerializer(data={'name': 'foo'})
 </s> add             serializer.fields
from django.utils.functional import cached_property
  from django.db import models
  from django.forms import widgets
  from django.utils import six
  from django.utils.datastructures import SortedDict
from django.utils.functional import cached_property
  from django.core.exceptions import ObjectDoesNotExist
  from rest_framework.settings import api_settings
  
  
  # Note: We do the following so that users of the framework can use this style:
  #
keep keep keep add keep keep keep keep keep keep
 Set up serializer fields lazily on-demand.

This avoids AppRegistryNotReady problems in Django 1.7 with nested serializers,
which are instantiated at import time, possibly before Django's app registry is
fully populated. 
rest_framework/serializers.py