def deleteAddress(self): """ """ # delete address toDeleteAddressId = self.context.request.get("id") am = IAddressManagement(self.context) am.deleteAddress(toDeleteAddressId) # add message putils = getToolByName(self.context, "plone_utils") putils.addPortalMessage(_("The address has been deleted.")) # redirect to addressbook url = "%s/manage-addressbook" % self.context.absolute_url() self.context.request.response.redirect(url)
def deleteAddress(self): """ """ # delete address toDeleteAddressId = self.context.request.get("id") am = IAddressManagement(self.context) am.deleteAddress(toDeleteAddressId) # add message putils = getToolByName(self.context, "plone_utils") putils.addPortalMessage(_("The address has been deleted.")) # redirect to addressbook url = "%s/manage-addressbook" % self.context.absolute_url() self.context.request.response.redirect(url)
def testDeleteAddress(self): """ """ am = IAddressManagement(self.customer) am.deleteAddress("address_1") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_2", "address_3"]) am.deleteAddress("address_2") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_3"]) am.deleteAddress("address_3") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, [])
def testDeleteAddress(self): """ """ am = IAddressManagement(self.customer) am.deleteAddress("address_1") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_2", "address_3"]) am.deleteAddress("address_2") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, ["address_3"]) am.deleteAddress("address_3") ids = [a.getId() for a in am.getAddresses()] self.assertEqual(ids, [])
def testDeleteAddress(self): """ """ am = IAddressManagement(self.customer) result = am.deleteAddress("address_1") self.assertEqual(result, False)
def testDeleteAddress(self): """ """ am = IAddressManagement(self.customer) result = am.deleteAddress("address_1") self.assertEqual(result, False)