  
          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()
  
          # Ensure source 1 is updated, and everything else is as expected
          queryset = NullableForeignKeySource.objects.all()
 
</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 
        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         #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         #BUG: Throws AttributeError - NoneType object has no attribute 'name'
        self.assertEquals(serializer.data, data)
        self.assertEqual(obj.name, u'source-4')

        #If null = True then target should be None
        serializer = NotRequiredSluggedNullableForeignKeySourceSerializer(data=data)
        #BUG: test case fails
        self.assertTrue(serializer.is_valid())
        #BUG: serializer.errors = {'target': [u'Value may not be null']}
        #BUG: serializer does not save object (But it can because its not required)
        obj = serializer.save()
        #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)
  
          serializer = DefaultSluggedNullableForeignKeySourceSerializer(instance, data=data)
          #BUG: is_valid() is False
          self.assertTrue(serializer.is_valid())














          self.assertEquals(serializer.data, data)
          serializer.save()
  
          # Ensure source 1 is updated, and everything else is as expected
          queryset = NullableForeignKeySource.objects.all()
keep keep keep keep 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