  from rest_framework import serializers
  from rest_framework.compat import patterns, url
  from rest_framework.tests.models import NullableForeignKeySource, ForeignKeyTarget
  
  def dummy_view(request, pk):
      pass
  
  
  # Nullable ForeignKey
  class SluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
      target = serializers.SlugRelatedField(slug_field='name')
 
</s> remove from rest_framework.compat import patterns, url
 </s> add  </s> remove 
# Nullable ForeignKey
class SluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
    target = serializers.SlugRelatedField(slug_field='name')
    class Meta:
        model = NullableForeignKeySource

class NullOKSluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
 </s> add class NullableSlugSourceSerializer(serializers.ModelSerializer): </s> remove class NotRequiredSluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
    target = serializers.SlugRelatedField(slug_field='name', required=False)
    class Meta:
        model = NullableForeignKeySource
 </s> add  </s> remove class DefaultSluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
    target = serializers.SlugRelatedField(slug_field='name', default='N/A')
 </s> add 
  from rest_framework import serializers
  from rest_framework.compat import patterns, url
  from rest_framework.tests.models import NullableForeignKeySource, ForeignKeyTarget
  


  
  
  # Nullable ForeignKey
  class SluggedNullableForeignKeySourceSerializer(serializers.ModelSerializer):
      target = serializers.SlugRelatedField(slug_field='name')
keep keep keep keep 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