      def test_invalid_read_only_fields(self):
          """
          Regression test for #652.
          """
          self.assertRaises(AssertionError, PersonSerializerInvalidReadOnly, [])
  
      def test_serializer_data_is_cleared_on_save(self):
          """
          Check _data attribute is cleared on `save()`
  
 
</s> remove     def test_exception_for_incorect_fk(self):
 </s> add     def test_exception_for_incorrect_fk(self): </s> remove             TestSerializer(data={'name': 'foo'})
 </s> add             serializer.fields </s> remove         self.fields = self.get_fields()
 </s> add 
        serializer = PersonSerializerInvalidReadOnly()
        with self.assertRaises(AssertionError):
            serializer.fields
      def test_invalid_read_only_fields(self):
          """
          Regression test for #652.
          """
        serializer = PersonSerializerInvalidReadOnly()
        with self.assertRaises(AssertionError):
            serializer.fields
  
      def test_serializer_data_is_cleared_on_save(self):
          """
          Check _data attribute is cleared on `save()`
  
keep keep keep keep replace 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. 
tests/test_serializer.py