#NEWLINE# def test_taggit_removes_tags( self ) : #NEWLINE# #INDENT# '\n        Test if the old assigned tags are removed\n        ' #NEWLINE# test_model = TestModel . objects . create ( ) #NEWLINE# test_model . tags . add ( '1' ) #NEWLINE# request_data = { #NEWLINE# #INDENT# 'tags' : [ '2' , '3' ] , #NEWLINE# #UNINDENT# } #NEWLINE# serializer = TestModelSerializer ( test_model , data = request_data ) #NEWLINE# serializer . is_valid ( ) #NEWLINE# test_model = serializer . save ( ) #NEWLINE# assert ( TestModel . objects . filter ( tags__name__in = [ '1' ] ) . count ( ) == 0 ) #NEWLINE# assert ( TestModel . objects . filter ( tags__name__in = [ '1' , '2' ] ) . count ( ) == 1 )