          data = {'name': u'source-1', 'target': ''}
          default_data = {'name': u'source-1', 'target': 'N/A'}
          expected_data = {'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']})
  
          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
          self.assertTrue(serializer.is_valid())
          #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
          self.assertEquals(serializer.data, data)
          serializer.save()
  
 
</s> remove         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
        self.assertTrue(serializer.is_valid())
        #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
 </s> add  </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         #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
        self.assertEquals(serializer.data, data)
 </s> add         self.assertEquals(serializer.data, expected_data) </s> remove         #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
        self.assertEquals(serializer.data, expected_data)
        self.assertEqual(obj.name, u'source-4')

        serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(data=data)
        #BUG: is_valid() is False
        self.assertTrue(serializer.is_valid())
        obj = serializer.save()
        #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
        self.assertEquals(serializer.data, expected_data)
        self.assertEqual(obj.name, u'source-4')

        serializer = DefaultSluggedNullableForeignKeySourceSerializer(data=data)
        #BUG: is_valid() is False
        self.assertTrue(serializer.is_valid())
        obj = serializer.save()
        #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
 </s> add  </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)
        serializer = NullableSlugSourceSerializer(instance, data=data)
          data = {'name': u'source-1', 'target': ''}
          default_data = {'name': u'source-1', 'target': 'N/A'}
          expected_data = {'name': u'source-1', 'target': None}
          instance = NullableForeignKeySource.objects.get(pk=1)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
        serializer = NullableSlugSourceSerializer(instance, data=data)
          self.assertTrue(serializer.is_valid())
          #BUG: Throws AttributeError: 'NoneType' object has no attribute 'name'
          self.assertEquals(serializer.data, data)
          serializer.save()
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace 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