              {'url': '/foreignkeysource/3/', 'name': u'source-3', 'target': '/foreignkeytarget/1/'}
          ]
          self.assertEquals(serializer.data, expected)
  
      def test_reverse_foreign_key_update(self):
          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())
          # We shouldn't have saved anything to the db yet since save
 
</s> remove         serializer = NullableSlugSourceSerializer(instance, data=data)
 </s> add         serializer = NullableForeignKeySourceSerializer(instance, data=data) </s> remove         serializer = NullableSlugSourceSerializer(instance, data=data)
 </s> add         serializer = NullableForeignKeySourceSerializer(instance, data=data) </s> remove         serializer = NullableSlugSourceSerializer(data=data)
 </s> add         serializer = NullableForeignKeySourceSerializer(data=data) </s> remove         serializer = NullableSlugSourceSerializer(data=data)
 </s> add         serializer = NullableForeignKeySourceSerializer(data=data)
    def test_foreign_key_update_incorrect_type(self):
        data = {'url': '/foreignkeysource/1/', 'name': u'source-1', 'target': 2}
        instance = ForeignKeySource.objects.get(pk=1)
        serializer = ForeignKeySourceSerializer(instance, data=data)
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'target': [u'Incorrect type.  Expected url string, received int.']})

              {'url': '/foreignkeysource/3/', 'name': u'source-3', 'target': '/foreignkeytarget/1/'}
          ]
          self.assertEquals(serializer.data, expected)
  
    def test_foreign_key_update_incorrect_type(self):
        data = {'url': '/foreignkeysource/1/', 'name': u'source-1', 'target': 2}
        instance = ForeignKeySource.objects.get(pk=1)
        serializer = ForeignKeySourceSerializer(instance, data=data)
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'target': [u'Incorrect type.  Expected url string, received int.']})

      def test_reverse_foreign_key_update(self):
          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())
          # We shouldn't have saved anything to the db yet since save
keep keep keep add keep keep keep keep keep keep
 Raise Validation Errors when relationships receive incorrect types. Fixes #590. 
rest_framework/tests/relations_hyperlink.py