          self.assertEquals(serializer.data, expected)
          serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(queryset)
          self.assertEquals(serializer.data, expected)
  
      def test_slug_foreign_key_update_with_valid_null(self):
          data = {'name': u'source-1', 'target': None}
          default_data = {'name': u'source-1', 'target': 'N/A'}
          instance = NullableForeignKeySource.objects.get(pk=1)
  
          serializer = SluggedNullableForeignKeySourceSerializer(instance, data=data)
          self.assertFalse(serializer.is_valid())
          self.assertEquals(serializer.errors, {'target': [u'Value may not be null']})
 
</s> remove 
        serializer = SluggedNullableForeignKeySourceSerializer(instance, data=data)
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'target': [u'Value may not be null']})

        serializer = DefaultSluggedNullableForeignKeySourceSerializer(instance, data=data)
        #BUG: is_valid() is False
 </s> add         serializer = NullableSlugSourceSerializer(instance, data=data) </s> remove         data = {'name': u'source-1', 'target': ''}
        default_data = {'name': u'source-1', 'target': 'N/A'}
        expected_data = {'name': u'source-1', 'target': None}
 </s> add         data = {'id': 1, 'name': u'source-1', 'target': ''}
        expected_data = {'id': 1, 'name': u'source-1', 'target': None} </s> remove 
        serializer = SluggedNullableForeignKeySourceSerializer(instance, data=data)
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'target': [u'Value may not be null']})

        serializer = DefaultSluggedNullableForeignKeySourceSerializer(instance, data=data)
        #BUG: is_valid() is False
        self.assertTrue(serializer.is_valid())
        self.assertEquals(serializer.data, default_data)
        serializer.save()

        serializer = NullOKSluggedNullableForeignKeySourceSerializer(instance, data=data)
        self.assertTrue(serializer.is_valid())
        #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
        self.assertEquals(serializer.data, data)
        serializer.save()

        serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(instance, data=data)
        #BUG: is_valid() is False
 </s> add         serializer = NullableSlugSourceSerializer(instance, data=data) </s> remove         serializer = SluggedNullableForeignKeySourceSerializer(queryset)
        #Throws 
        self.assertEquals(serializer.data, expected)

    def test_slug_foreign_key_create_with_valid_null(self):
        data = {'name': u'source-4', 'target': None}
        default_data = {'name': u'source-4', 'target': 'N/A'}

        serializer = SluggedNullableForeignKeySourceSerializer(data=data)
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'target': [u'Value may not be null']})


        #If attribute not required, data should match
        serializer = NullOKSluggedNullableForeignKeySourceSerializer(data=data)
        self.assertTrue(serializer.is_valid())
        obj = serializer.save()
        #BUG: Throws AttributeError: "NoneType object has no attribute 'name'"
        self.assertEquals(serializer.data, data)
        self.assertEqual(obj.name, u'source-4')

        #If default = 'N/A' then target should pass validation, and be the default ('N/A')
        serializer = DefaultSluggedNullableForeignKeySourceSerializer(data=data)
        #BUG: test case fails
 </s> add     def test_foreign_key_create_with_valid_null(self):
        data = {'id': 4, 'name': u'source-4', 'target': None}
        serializer = NullableSlugSourceSerializer(data=data) </s> remove         #BUG: All serializers fail here
        serializer = DefaultSluggedNullableForeignKeySourceSerializer(queryset)
        self.assertEquals(serializer.data, default_expected)
        serializer = NullOKSluggedNullableForeignKeySourceSerializer(queryset)
        self.assertEquals(serializer.data, expected)
        serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(queryset)
 </s> add 
    def test_foreign_key_update_with_valid_null(self):
        data = {'id': 1, 'name': u'source-1', 'target': None}
          self.assertEquals(serializer.data, expected)
          serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(queryset)
          self.assertEquals(serializer.data, expected)
  
    def test_foreign_key_update_with_valid_null(self):
        data = {'id': 1, 'name': u'source-1', 'target': None}
    def test_foreign_key_update_with_valid_null(self):
        data = {'id': 1, 'name': u'source-1', 'target': None}
    def test_foreign_key_update_with_valid_null(self):
        data = {'id': 1, 'name': u'source-1', 'target': None}
          instance = NullableForeignKeySource.objects.get(pk=1)
  
          serializer = SluggedNullableForeignKeySourceSerializer(instance, data=data)
          self.assertFalse(serializer.is_valid())
          self.assertEquals(serializer.errors, {'target': [u'Value may not be null']})
keep keep keep keep replace replace replace keep keep keep keep keep
 Drop bits of relations_slug tests which don't mirror existing tests. 
rest_framework/tests/relations_slug.py