server/test/unittest_hooks.py
branchstable
changeset 3526 dfb2ebb765e2
parent 2923 b97a0f8dd4dc
--- a/server/test/unittest_hooks.py	Tue Sep 29 15:10:12 2009 -0700
+++ b/server/test/unittest_hooks.py	Wed Sep 30 16:05:43 2009 +0200
@@ -502,5 +502,15 @@
                      'RT name "prenom", E name "Personne"')
         self.commit()
 
+
+    def test_add_attribute_to_base_class(self):
+        self.execute('INSERT CWAttribute X: X cardinality "11", X defaultval "noname", X indexed TRUE, X relation_type RT, X from_entity E, X to_entity F '
+                     'WHERE RT name "nom", E name "BaseTransition", F name "String"')
+        self.commit()
+        self.schema.rebuild_infered_relations()
+        self.failUnless('Transition' in self.schema['nom'].subjects())
+        self.failUnless('WorkflowTransition' in self.schema['nom'].subjects())
+        self.execute('Any X WHERE X is_instance_of BaseTransition, X nom "hop"')
+
 if __name__ == '__main__':
     unittest_main()