Ejemplo n.º 1
0
    def test_status_update_rejected(self):
        o = OrderFactory.create(state='pending')
        t = TransactionFactory.create(status='pending', order=o)

        data = dict(Status=dict(Code=dict(Code=BUCKAROO_690_REJECTED)))

        update_transaction(transaction=t, data=data)

        assert t.status == t.STATUS_REJECTED
Ejemplo n.º 2
0
    def test_status_update_cancelled(self):
        o = OrderFactory.create(state='pending')
        t = TransactionFactory.create(status='pending', order=o)

        data = dict(Status=dict(Code=dict(
            Code=BUCKAROO_890_CANCELLED_BY_USER)))

        update_transaction(transaction=t, data=data)

        assert t.status == t.STATUS_CANCELLED
Ejemplo n.º 3
0
    def test_status_update_success(self):
        o = OrderFactory.create(state='pending')
        t = TransactionFactory.create(status='pending', order=o)

        data = dict(Status=dict(Code=dict(Code=BUCKAROO_190_SUCCESS)))

        update_transaction(transaction=t, data=data)

        assert t.status == t.STATUS_SUCCESS
        assert t.last_push is not None
Ejemplo n.º 4
0
    def test_update_no_code(self):
        o = OrderFactory.create(state='pending')
        t = TransactionFactory.create(order=o)
        data = {1: 1}

        assert t.last_push is None

        update_transaction(transaction=t, data=data)

        assert t.status == t.STATUS_NEW
        assert t.last_push is not None
Ejemplo n.º 5
0
 def test_no_data(self):
     res = update_transaction(transaction=1)
     assert res is None
Ejemplo n.º 6
0
 def test_no_transaction(self):
     res = update_transaction(data=1)
     assert res is None