#NEWLINE# def test_manage_add_price_criteria( self ) : #NEWLINE# #INDENT# self . client . login ( username = self . username , password = self . password ) #NEWLINE# shipping_method = ShippingMethod . objects . create ( name = 'Standard' , active = True ) #NEWLINE# smp = ShippingMethodPrice . objects . create ( shipping_method = shipping_method , price = 10 ) #NEWLINE# country_id = Country . objects . all ( ) [ 0 ] . pk #NEWLINE# url = reverse ( 'lfs_manage_save_shipping_price_criteria' , kwargs = dict ( shipping_price_id = smp . pk ) ) #NEWLINE# data = { #NEWLINE# #INDENT# 'type-123' : 'lfs.criteria.models.CountryCriterion' , #NEWLINE# 'operator-123' : Criterion . IS_SELECTED , #NEWLINE# 'position-123' : '10' , #NEWLINE# 'value-123' : country_id , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , data , follow = True ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# c = CountryCriterion . objects . latest ( 'id' ) #NEWLINE# self . assertTrue ( ( country_id in c . value . values_list ( 'id' , flat = True ) ) )