[Checkins] SVN: z3c.form/trunk/src/z3c/form/group. bring test coverage back up to 100% and make the change PvW suggested.

Paul Carduner paulcarduner at gmail.com
Sat May 24 22:52:31 EDT 2008


Log message for revision 86937:
  bring test coverage back up to 100% and make the change PvW suggested.

Changed:
  U   z3c.form/trunk/src/z3c/form/group.py
  U   z3c.form/trunk/src/z3c/form/group.txt

-=-
Modified: z3c.form/trunk/src/z3c/form/group.py
===================================================================
--- z3c.form/trunk/src/z3c/form/group.py	2008-05-24 20:22:01 UTC (rev 86936)
+++ z3c.form/trunk/src/z3c/form/group.py	2008-05-25 02:52:28 UTC (rev 86937)
@@ -78,7 +78,7 @@
         for groupClass in self.groups:
             # only instantiate the groupClass if it hasn't already
             # been instantiated
-            if type(groupClass) is type:
+            if isinstance(groupClass, type):
                 group = groupClass(self.context, self.request, self)
             else:
                 group = groupClass

Modified: z3c.form/trunk/src/z3c/form/group.txt
===================================================================
--- z3c.form/trunk/src/z3c/form/group.txt	2008-05-24 20:22:01 UTC (rev 86936)
+++ z3c.form/trunk/src/z3c/form/group.txt	2008-05-25 02:52:28 UTC (rev 86937)
@@ -96,6 +96,13 @@
   >>> add.groups
   (<LicenseGroup object at ...>, <CarGroup object at ...>)
 
+If we happen to update the add form again, the groups that have
+already been converted to instances ares skipped.
+
+  >>> add.update()
+  >>> add.groups
+  (<LicenseGroup object at ...>, <CarGroup object at ...>)
+
 We can now render the form:
 
   >>> print add.render()



More information about the Checkins mailing list