Index: /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_payment.py
===================================================================
--- /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_payment.py	(revision 12133)
+++ /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_payment.py	(revision 12133)
@@ -0,0 +1,43 @@
+## $Id$
+##
+## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import re
+import unittest
+from zope.interface.verify import verifyClass, verifyObject
+from waeup.ikoba.payments.interfaces import IPayment
+from waeup.ikoba.payments.payment import Payment
+
+
+class PaymentTests(unittest.TestCase):
+
+    def test_iface(self):
+        # Payments fullfill any interface contracts
+        obj = Payment()
+        verifyClass(IPayment, Payment)
+        verifyObject(IPayment, obj)
+
+    def test_payment_id_unique(self):
+        # we get unique payment ids
+        p1, p2 = Payment(), Payment()
+        id1, id2 = p1.payment_id, p2.payment_id
+        assert id1 != id2
+
+    def test_payment_id_format(self):
+        # payment ids have a special format: "PAY_<32 hex digits>"
+        id1 = Payment().payment_id
+        assert isinstance(id1, basestring)
+        assert re.match('PAY_[0-9a-f]{32}', id1)
