示例#1
0
    def test_is_successful_errored(self):
        card = Card()
        card.status = "errored"
        payment = Payment()
        payment.card = card

        self.assertFalse(payment.is_successful())
示例#2
0
    def test_is_successful_declined(self):
        card = Card()
        card.status = "declined"
        payment = Payment(source='card')
        payment.card = card

        self.assertFalse(payment.is_successful())
示例#3
0
    def test_is_successful(self):
        card = Card()
        card.status = "processed"
        payment = Payment(source='card')
        payment.card = card

        self.assertTrue(payment.is_successful())
示例#4
0
    def test_is_successful(self):
        card = Card()
        card.status = "processed"
        payment1 = Payment()
        payment1.card = card

        bank = Bank()
        bank.status = "processed"
        payment2 = Payment()
        payment2.bank = bank

        self.assertTrue(payment1.is_successful())
        self.assertTrue(payment2.is_successful())
示例#5
0
    def test_no_source_is_not_successful(self):
        card = Card()
        payment = Payment()
        payment.card = card

        self.assertFalse(payment.is_successful())