test/unittest_selectors.py
branchtls-sprint
changeset 1473 717dea3362c0
parent 779 8510e14335e1
child 1571 e9ad2724659d
--- a/test/unittest_selectors.py	Fri Apr 24 15:37:51 2009 +0200
+++ b/test/unittest_selectors.py	Fri Apr 24 15:38:11 2009 +0200
@@ -7,9 +7,9 @@
 
 from logilab.common.testlib import TestCase, unittest_main
 
+from cubicweb.devtools.testlib import EnvBasedTC
 from cubicweb.vregistry import Selector, AndSelector, OrSelector
 from cubicweb.selectors import implements
-
 from cubicweb.interfaces import IDownloadable
 
 class _1_(Selector):
@@ -48,7 +48,7 @@
         self.assertEquals(selector(None), 3)
         selector = _2_ & _1_()
         self.assertEquals(selector(None), 3)
-        
+
     def test_three_and(self):
         selector = _1_() & _1_() & _1_()
         self.assertEquals(selector(None), 3)
@@ -84,8 +84,7 @@
         self.assertIs(csel.search_selector(implements), sel)
         csel = AndSelector(Selector(), sel)
         self.assertIs(csel.search_selector(implements), sel)
-        
-from cubicweb.devtools.testlib import EnvBasedTC
+
 
 class ImplementsSelectorTC(EnvBasedTC):
     def test_etype_priority(self):
@@ -96,7 +95,11 @@
         self.failUnless(idownscore > anyscore, (idownscore, anyscore))
         filescore = implements('File').score_class(cls, req)
         self.failUnless(filescore > idownscore, (filescore, idownscore))
-    
+
+    def test_etype_inheritance_no_yams_inheritance(self):
+        cls = self.vreg.etype_class('Personne')
+        self.failIf(implements('Societe').score_class(cls, self.request()))
+
 if __name__ == '__main__':
     unittest_main()