[Zope3-checkins] CVS: Zope3/lib/python/Zope/Schema/tests - testEquality.py:1.1

Martijn Faassen m.faassen@vet.uu.nl
Wed, 11 Dec 2002 09:49:07 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Schema/tests
In directory cvs.zope.org:/tmp/cvs-serv18264/tests

Added Files:
	testEquality.py 
Log Message:
Added the ability to compare fields for equality. Also got rid of an
'L' in 'order'; if we ever will have more than maxint fields 
we'll worry about that then (and python will automatically upgrade ints 
anyway, right?). 


=== Added File Zope3/lib/python/Zope/Schema/tests/testEquality.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: testEquality.py,v 1.1 2002/12/11 14:49:07 faassen Exp $
"""
from unittest import TestCase, TestSuite, makeSuite
from Zope.Schema import Field, Text, Int

class FieldEqualityTests(TestCase):

    equality = [
        'Text(title=u"Foo", description=u"Bar")',
        'Int(title=u"Foo", description=u"Bar")',
        ]
    
    def test_equality(self):
        for text in self.equality:
            self.assertEquals(eval(text), eval(text))

def test_suite():
    return TestSuite(
        [makeSuite(FieldEqualityTests)])