[7195] | 1 | ## $Id: test_interfaces.py 12311 2014-12-24 09:17:05Z uli $ |
---|
| 2 | ## |
---|
[6864] | 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. |
---|
[7195] | 8 | ## |
---|
[6864] | 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. |
---|
[7195] | 13 | ## |
---|
[6864] | 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 | """ |
---|
[12311] | 19 | Tests for payments interfaces. |
---|
[6864] | 20 | """ |
---|
[12311] | 21 | from waeup.ikoba.payments.interfaces import PaymentGatewayServicesSource |
---|
[11949] | 22 | from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase) |
---|
[6864] | 23 | |
---|
[12010] | 24 | |
---|
[6864] | 25 | class PaymentsContainerTestCase(FunctionalTestCase): |
---|
| 26 | |
---|
| 27 | layer = FunctionalLayer |
---|
| 28 | |
---|
[12311] | 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 |
---|
[6864] | 35 | |
---|
[12311] | 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) |
---|