      #     obj = serializer.save()
      #     self.assertEquals(serializer.data, data)
      #     self.assertEqual(obj.name, u'target-3')
  
      #     # Ensure target 4 is added, and everything else is as expected
      #     queryset = ForeignKeyTarget.objects.all()
      #     serializer = ForeignKeyTargetSerializer(queryset)
      #     expected = [
      #         {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
      #         {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
      #         {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
      #     ]
      #     self.assertEquals(serializer.data, expected)
  
      def test_foreign_key_update_with_invalid_null(self):
          data = {'url': '/foreignkeysource/1/', 'name': u'source-1', 'target': None}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data)
 
</s> remove     # TODO: Check this - is this a bug or is the test incorrect?
    # def test_reverse_foreign_key_create(self):
    #     data = {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']}
    #     serializer = ForeignKeyTargetSerializer(data=data)
    #     self.assertTrue(serializer.is_valid())
    #     obj = serializer.save()
    #     self.assertEquals(serializer.data, data)
    #     self.assertEqual(obj.name, u'target-3')
 </s> add     def test_reverse_foreign_key_create(self):
        data = {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']}
        serializer = ForeignKeyTargetSerializer(data=data)
        self.assertTrue(serializer.is_valid())
        obj = serializer.save()
        self.assertEquals(serializer.data, data)
        self.assertEqual(obj.name, u'target-3') </s> remove     sources = serializers.ManyHyperlinkedRelatedField(view_name='foreignkeysource-detail', read_only=True)
 </s> add     sources = serializers.ManyHyperlinkedRelatedField(view_name='foreignkeysource-detail')
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
      #     obj = serializer.save()
      #     self.assertEquals(serializer.data, data)
      #     self.assertEqual(obj.name, u'target-3')
  
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
        # Ensure target 4 is added, and everything else is as expected
        queryset = ForeignKeyTarget.objects.all()
        serializer = ForeignKeyTargetSerializer(queryset)
        expected = [
            {'url': '/foreignkeytarget/1/', 'name': u'target-1', 'sources': ['/foreignkeysource/2/']},
            {'url': '/foreignkeytarget/2/', 'name': u'target-2', 'sources': []},
            {'url': '/foreignkeytarget/3/', 'name': u'target-3', 'sources': ['/foreignkeysource/1/', '/foreignkeysource/3/']},
        ]
        self.assertEquals(serializer.data, expected)
  
      def test_foreign_key_update_with_invalid_null(self):
          data = {'url': '/foreignkeysource/1/', 'name': u'source-1', 'target': None}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data)
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Add test for hyperlinked reverse FK create.  Refs #511 
rest_framework/tests/relations_hyperlink.py