source: main/waeup.kofa/trunk/src/waeup/kofa/payments/tests.py @ 17176

Last change on this file since 17176 was 13012, checked in by Henrik Bettermann, 9 years ago

Revert changes from r13007.

  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1## $Id: tests.py 13012 2015-05-28 13:55:06Z henrik $
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"""
19Tests for payments.
20"""
21from zope.interface.verify import verifyClass, verifyObject
22from waeup.kofa.payments.interfaces import (
23    IPaymentsContainer, IOnlinePayment)
24from waeup.kofa.payments.container import PaymentsContainer
25from waeup.kofa.payments.payment import OnlinePayment
26from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase)
27
28class PaymentsContainerTestCase(FunctionalTestCase):
29
30    layer = FunctionalLayer
31
32    def test_interfaces(self):
33        # Make sure the correct interfaces are implemented.
34        self.assertTrue(
35            verifyClass(
36                IPaymentsContainer, PaymentsContainer)
37            )
38        self.assertTrue(
39            verifyObject(
40                IPaymentsContainer, PaymentsContainer())
41            )
42        self.assertTrue(
43            verifyClass(
44                IOnlinePayment, OnlinePayment)
45            )
46        self.assertTrue(
47            verifyObject(
48                IOnlinePayment, OnlinePayment())
49            )
50        return
51
52    def test_base(self):
53        # We cannot call the fundamental methods of a base in that case
54        container = PaymentsContainer()
55        self.assertRaises(
56            NotImplementedError, container.archive)
57        self.assertRaises(
58            NotImplementedError, container.clear)
Note: See TracBrowser for help on using the repository browser.