#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# '\n        ' #NEWLINE# ie = Country . objects . get ( code = 'ie' ) #NEWLINE# us = Country . objects . get ( code = 'us' ) #NEWLINE# shop = get_default_shop ( ) #NEWLINE# for ic in Country . objects . all ( ) : #NEWLINE# #INDENT# shop . invoice_countries . add ( ic ) #NEWLINE# #UNINDENT# shop . save ( ) #NEWLINE# tax = Tax . objects . create ( rate = 19 ) #NEWLINE# shipping_method = ShippingMethod . objects . create ( name = 'Standard' , active = True , price = 1.0 , tax = tax ) #NEWLINE# self . by_invoice = PaymentMethod . objects . get ( pk = BY_INVOICE ) #NEWLINE# address1 = Address . objects . create ( firstname = 'John' , lastname = 'Doe' , company_name = 'Doe Ltd.' , line1 = 'Street 42' , city = 'Gotham City' , zip_code = '2342' , country = ie ) #NEWLINE# address2 = Address . objects . create ( firstname = 'Jane' , lastname = 'Doe' , company_name = 'Doe Ltd.' , line1 = 'Street 43' , city = 'Smallville' , zip_code = '2443' , country = us ) #NEWLINE# self . username = 'joe' #NEWLINE# self . password = 'bloggs' #NEWLINE# new_user = User ( username = self . username ) #NEWLINE# new_user . set_password ( self . password ) #NEWLINE# new_user . save ( ) #NEWLINE# self . customer = Customer . objects . create ( user = new_user , selected_shipping_method = shipping_method , selected_payment_method = self . by_invoice , selected_shipping_address = address1 , selected_invoice_address = address2 , default_shipping_address = address1 , default_invoice_address = address2 ) #NEWLINE# self . PRODUCT1_NAME = 'Surfboard' #NEWLINE# p1 = Product . objects . create ( name = p2 . PRODUCT1_NAME , slug = 'product-1' , sku = 'sku-1' , price = 1.1 , tax = tax , active = True ) #NEWLINE# p2 = Product . objects . create ( name = 'Product 2' , slug = 'product-2' , sku = 'sku-2' , price = 2.2 , tax = tax , active = True ) #NEWLINE# cart = Cart . objects . create ( user = new_user ) #NEWLINE# item = CartItem . objects . create ( cart = cart , product = p1 , amount = 2 ) #NEWLINE# item = CartItem . objects . create ( cart = cart , product = p2 , amount = 3 )