#NEWLINE# def test_set_reverse( self ) : #NEWLINE# #INDENT# e = Entree . create ( name = 'phad thai' ) #NEWLINE# s = Tag . create ( tag = 'spicy' ) #NEWLINE# p = Tag . create ( tag = 'peanuts' ) #NEWLINE# t = Tag . create ( tag = 'thai' ) #NEWLINE# b = Tag . create ( tag = 'beverage' ) #NEWLINE# e . tags = Tag . select ( ) . where ( ( Tag . tag != 'beverage' ) ) #NEWLINE# self . assertEqual ( [ t . tag for t in e . tags ] , [ 'peanuts' , 'spicy' , 'thai' ] ) #NEWLINE# e = Entree . create ( name = 'panang curry' ) #NEWLINE# c = Tag . create ( tag = 'coconut' ) #NEWLINE# e . tags = [ p , t , c , p ] #NEWLINE# self . assertEqual ( [ t . tag for t in e . tags ] , [ 'coconut' , 'peanuts' , 'spicy' , 'thai' ] )