def testGetPaymentMethods(self):
        """Get all payment methods (without parameter)
        """
        pm = IPaymentMethodManagement(self.shop)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(['cash-on-delivery', 'credit-card', 'direct-debit', 'paypal', 'prepayment'], ids)
    def testDeletePaymentMethod(self):
        """
        """            
        pm = IPaymentMethodManagement(self.shop)

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

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

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

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, True)
        
        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(['cash-on-delivery', 'credit-card', 'direct-debit'], 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", "credit-card"], ids)

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

        result = pm.deletePaymentMethod("prepayment")
        self.assertEqual(result, False)
    def testGetPaymentMethods(self):
        """Get all payment methods (without parameter)
        """
        pm = IPaymentMethodManagement(self.shop)

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual([
            'cash-on-delivery', 'credit-card', 'direct-debit', 'paypal',
            'prepayment'
        ], ids)
    def testDeletePaymentMethod(self):
        """
        """
        pm = IPaymentMethodManagement(self.shop)

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

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

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

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

        ids = [p.getId() for p in pm.getPaymentMethods()]
        self.assertEqual(['cash-on-delivery', 'credit-card', 'direct-debit'],
                         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", "credit-card"], ids)

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

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