#NEWLINE# def test_ignore_excluded_fields( self ) : #NEWLINE# #INDENT# '\n        When model fields are not included in a serializer, then uniqueness\n        validators should not be added for that field.\n        ' #NEWLINE# class ExcludedFieldSerializer ( serializers . ModelSerializer ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = UniquenessTogetherModel #NEWLINE# fields = ( 'id' , 'race_name' ) #NEWLINE# #UNINDENT# #UNINDENT# serializer = ExcludedFieldSerializer ( ) #NEWLINE# expected = dedent ( "\n            ExcludedFieldSerializer():\n                id = IntegerField(label='ID', read_only=True)\n                race_name = CharField(max_length=100)\n        " ) #NEWLINE# assert ( repr ( serializer ) == expected )