[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/schemagen/tests - test_modulegen.py:1.4

Martijn Faassen m.faassen@vet.uu.nl
Thu, 12 Dec 2002 07:14:52 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/schemagen/tests
In directory cvs.zope.org:/tmp/cvs-serv27980/tests

Modified Files:
	test_modulegen.py 
Log Message:
Fixed __schema_version__; it should be on the instance of the class 
generated, not the class itself.


=== Zope3/lib/python/Zope/App/schemagen/tests/test_modulegen.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/App/schemagen/tests/test_modulegen.py:1.3	Thu Dec 12 05:45:53 2002
+++ Zope3/lib/python/Zope/App/schemagen/tests/test_modulegen.py	Thu Dec 12 07:14:52 2002
@@ -52,7 +52,9 @@
         from Zope.Schema.FieldProperty import FieldProperty
         IFoo = self.g['IFoo']
         Foo = self.g['Foo']
-        self.assertEquals(Foo.__schema_version__, 0)
+        # we don't want a schema version attribute on the class, just
+        # on the individual instances
+        self.assertRaises(AttributeError, getattr, Foo, '__schema_version__')
         self.assertEquals(Foo.__implements__, IFoo)
         for field_name, field in self.fields:
             prop = getattr(Foo, field_name, None)
@@ -62,6 +64,7 @@
     def test_instance(self):
         Foo = self.g['Foo']
         foo = Foo()
+        self.assertEquals(foo.__schema_version__, 0)
         for field_name, field in self.fields:
             self.assertEquals(field.default, getattr(foo, field_name))