1 | ## $Id: test_interfaces.py 12311 2014-12-24 09:17:05Z uli $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | """ |
---|
19 | Tests for payments interfaces. |
---|
20 | """ |
---|
21 | from waeup.ikoba.payments.interfaces import PaymentGatewayServicesSource |
---|
22 | from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase) |
---|
23 | |
---|
24 | |
---|
25 | class PaymentsContainerTestCase(FunctionalTestCase): |
---|
26 | |
---|
27 | layer = FunctionalLayer |
---|
28 | |
---|
29 | def test_payment_gateway_services_source(self): |
---|
30 | # the payment gateway services source provides a list of registered |
---|
31 | # payment gateways |
---|
32 | source = PaymentGatewayServicesSource() |
---|
33 | services = list(source) |
---|
34 | assert len(services) > 0 |
---|
35 | |
---|
36 | def test_payment_gateway_services_source_title(self): |
---|
37 | # we can get titles from gateway sources |
---|
38 | source = PaymentGatewayServicesSource() |
---|
39 | service1 = list(source)[0] |
---|
40 | title = source.factory.getTitle(service1) |
---|
41 | assert title != service1 |
---|
42 | assert isinstance(title, basestring) |
---|