def testIsComplete(self): """ """ c = ICompleteness(self.shop.customers.customer) self.assertEqual(c.isComplete(), False) am = IAddressManagement(self.customer) id = am.addAddress({ "firstname": u"John", "lastname": u"Doe", "address_1": u"Doe Str. 1", "zip_code": u"4711", "city": u"Doe City", "country": u"Germany" }) self.customer.selected_invoice_address = id self.customer.selected_shipping_address = id self.assertEqual(c.isComplete(), False) view = getMultiAdapter((self.shop.products.product_1, self.shop.products.product_1.REQUEST), name="addToCart") view.addToCart() self.assertEqual(c.isComplete(), True)
def testAddAddress(self): """ """ am = IAddressManagement(self.customer) id = am.addAddress({ "firstname": u"John", "lastname": u"Doe", "address_1": u"Doe Str. 1", "zip_code": u"4711", "city": u"Doe City", "country": u"Germany" }) ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_1", "address_2", "address_3", id])
def testAddAddress(self): """ """ am = IAddressManagement(self.customer) id = am.addAddress({ "firstname" : u"John", "lastname" : u"Doe", "address_1" : u"Doe Str. 1", "zip_code" : u"4711", "city" : u"Doe City", "country" : u"Germany" }) ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_1", "address_2", "address_3", id])
def testIsComplete(self): """ """ c = ICompleteness(self.shop.customers.customer) self.assertEqual(c.isComplete(), False) am = IAddressManagement(self.customer) id = am.addAddress({ "firstname" : u"John", "lastname" : u"Doe", "address_1" : u"Doe Str. 1", "zip_code" : u"4711", "city" : u"Doe City", "country" : u"Germany" }) self.customer.selected_invoice_address= id self.customer.selected_shipping_address = id self.assertEqual(c.isComplete(), False) view = getMultiAdapter((self.shop.products.product_1, self.shop.products.product_1.REQUEST), name="addToCart") view.addToCart() self.assertEqual(c.isComplete(), True)