예제 #1
0
    def test_payin_bank_wire_creation(self):
        path = b'/janet/wallet/payin/bankwire/'
        data = {'amount': str(upcharge_bank_wire(EUR('10.00'))[0].amount)}

        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 403  # rejected because janet has no donations set up

        self.janet.set_tip_to(self.david, EUR('10.00'))
        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 302, r.text
        redir = r.headers[b'Location']
        assert redir.startswith(path + b'?exchange_id=')

        r = self.client.GET(redir, auth_as=self.janet)
        assert b'IBAN' in r.body, r.text

        janet = self.janet.refetch()
        assert janet.balance == 0
예제 #2
0
    def test_payin_bank_wire_creation(self):
        path = b'/janet/wallet/payin/bankwire/'
        data = {'amount': str(upcharge_bank_wire(EUR('10.00'))[0].amount)}

        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 403  # rejected because janet has no donations set up

        self.janet.set_tip_to(self.david, EUR('10.00'))
        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 302, r.text
        redir = r.headers[b'Location']
        assert redir.startswith(path+b'?exchange_id=')

        r = self.client.GET(redir, auth_as=self.janet)
        assert b'IBAN' in r.body, r.text

        janet = self.janet.refetch()
        assert janet.balance == 0
예제 #3
0
    def test_payin_bank_wire_creation(self):
        # Currently only admins can create bankwire payins.
        self.db.run("UPDATE participants SET privileges = 1 WHERE username = '******'")

        path = b'/janet/wallet/payin/bankwire/'
        data = {'amount': str(upcharge_bank_wire(EUR('10.00'))[0].amount)}

        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 403  # rejected because janet has no donations set up

        self.janet.set_tip_to(self.david, EUR('10.00'))
        r = self.client.PxST(path, data, auth_as=self.janet)
        assert r.code == 302, r.text
        redir = r.headers[b'Location']
        assert redir.startswith(path+b'?exchange_id=')

        r = self.client.GET(redir, auth_as=self.janet)
        assert b'IBAN' in r.body, r.text

        janet = self.janet.refetch()
        assert janet.balance == 0