Ejemplo n.º 1
0
    def testDeletePaymentMethod(self):
        """
        """
        pm = IPaymentManagement(self.shop)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(
            ["paypal", "direct-debit", "prepayment", "cash-on-delivery"], ids)

        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, True)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["direct-debit", "prepayment", "cash-on-delivery"],
                         ids)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, True)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["direct-debit", "cash-on-delivery"], ids)

        # delete payment validor
        result = pm.deletePaymentMethod("direct-debit")
        self.assertEqual(result, True)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["cash-on-delivery"], ids)

        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, False)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, False)
Ejemplo n.º 2
0
    def testDeletePaymentMethod(self):
        """
        """            
        pm = IPaymentManagement(self.shop)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["paypal", "direct-debit", "prepayment", "cash-on-delivery"], ids)

        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, True)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["direct-debit", "prepayment", "cash-on-delivery"], ids)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, True)
        
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["direct-debit", "cash-on-delivery"], ids)

        # delete payment validor
        result = pm.deletePaymentMethod("direct-debit")
        self.assertEqual(result, True)
        
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["cash-on-delivery"], ids)

        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, False)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, False)
    def testDeletePaymentMethod(self):
        """
        """            
        pm = IPaymentManagement(self.customer)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["directdebit"], ids)

        # Shop level payment methods shouldn't be deletable here.
        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, False)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, False)
        
        # still all there?
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["directdebit"], ids)

        result = pm.deletePaymentMethod("directdebit")        
        self.assertEqual(result, True)
                
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual([], ids)
Ejemplo n.º 4
0
    def testDeletePaymentMethod(self):
        """
        """
        pm = IPaymentManagement(self.customer)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["directdebit"], ids)

        # Shop level payment methods shouldn't be deletable here.
        result = pm.deletePaymentMethod("paypal")
        self.assertEqual(result, False)

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, False)

        # still all there?
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(["directdebit"], ids)

        result = pm.deletePaymentMethod("directdebit")
        self.assertEqual(result, True)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual([], ids)