          data = {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']}
          instance = ForeignKeyTarget.objects.get(pk=2)
          serializer = ForeignKeyTargetSerializer(instance, data=data)
          self.assertTrue(serializer.is_valid())
          self.assertEquals(serializer.data, data)
          serializer.save()
  
          # Ensure target 2 is update, and everything else is as expected
          queryset = ForeignKeyTarget.objects.all()
          serializer = ForeignKeyTargetSerializer(queryset)
 
</s> remove         self.assertEquals(serializer.data, data)
 </s> add         # We shouldn't have saved anything to the db yet since save
        # hasn't been called.
        queryset = ForeignKeyTarget.objects.all()
        new_serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'id': 1, 'name': u'target-1', 'sources': [1, 2, 3]},
            {'id': 2, 'name': u'target-2', 'sources': []},
        ]        
        self.assertEquals(new_serializer.data, expected)
 </s> remove         self.assertEquals(serializer.data, data)
 </s> add  </s> remove         # Ensure target 4 is added, and everything else is as expected
 </s> add         # Ensure target 3 is added, and everything else is as expected
          data = {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']}
          instance = ForeignKeyTarget.objects.get(pk=2)
          serializer = ForeignKeyTargetSerializer(instance, data=data)
          self.assertTrue(serializer.is_valid())

          serializer.save()
  
          # Ensure target 2 is update, and everything else is as expected
          queryset = ForeignKeyTarget.objects.all()
          serializer = ForeignKeyTargetSerializer(queryset)
keep keep keep keep replace keep keep keep keep keep
 Don't persist relation changes in ModelSerializer#restore_object() 
rest_framework/tests/relations_hyperlink.py