def testGetSelectedPaymentMethod_1(self):
        """Customer has selected prepayment by default.
        """
        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "prepayment")
示例#2
0
    def testGetSelectedPaymentMethod_1(self):
        """Customer has selected prepayment by default.
        """
        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "prepayment")
示例#3
0
    def testGetPaymentInformations(self):
        """Get all payment methods (without parameter)
        """
        pm = IPaymentInformationManagement(self.customer)

        ids = [p.getId() for p in pm.getPaymentInformations()]
        self.assertEqual(["bank-account"], ids)
示例#4
0
    def testGetSelectedPaymentMethod_2(self):
        """Customer has selected paypal.
        """
        self.customer.selected_payment_method = "paypal"

        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "paypal")
    def testGetSelectedPaymentMethod_2(self):
        """Customer has selected paypal.
        """
        self.customer.selected_payment_method = "paypal"
        
        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "paypal")
示例#6
0
    def testGetSelectedPaymentMethod_3(self):
        """Customer has selected a non existing. Returns default, which is 
        prepayment atm.
        """
        self.customer.selected_payment_method = "dummy"

        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "prepayment")
    def testGetSelectedPaymentMethod_3(self):
        """Customer has selected a non existing. Returns default, which is 
        prepayment atm.
        """
        self.customer.selected_payment_method = "dummy"

        pm = IPaymentInformationManagement(self.customer)
        result = pm.getSelectedPaymentMethod().getId()

        self.assertEqual(result, "prepayment")
示例#8
0
    def testDeletePaymentInformations(self):
        """
        """            
        pm = IPaymentInformationManagement(self.customer)
        
        ids = [p.getId() for p in pm.getPaymentInformations()]
        self.assertEqual(["bank-account"], ids)

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

        result = pm.deletePaymentInformation("prepayment")
        self.assertEqual(result, False)
        
        # still all there?
        ids = [p.getId() for p in pm.getPaymentInformations()]
        self.assertEqual(["bank-account"], ids)

        result = pm.deletePaymentInformation("bank-account")        
        self.assertEqual(result, True)
                
        ids = [p.getId() for p in pm.getPaymentInformations()]
        self.assertEqual([], ids)
示例#9
0
 def testGetSelectedPaymentInformation(self):
     """
     """
     pm = IPaymentInformationManagement(self.customer)
     result = pm.getSelectedPaymentInformation()
     self.failUnless(result is None)