def test_charge_fail(self): transaction = Transaction(api_key='apikey', amount=314, card_hash='foobar', payment_method='credit_card', installments=1, postback_url='https://post.back.url') with self.assertRaises(PygarmeTransactionApiError): transaction.charge()
def test_charge(self): transaction = Transaction(api_key='apikey', amount=314, card_hash='foobar', payment_method='credit_card', installments=1, postback_url='https://post.back.url') transaction.charge() self.assertEqual('processing', transaction.status)