api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Dec 2009 12:52:30 +0100
changeset 4078 3704c121624c
parent 4077 1d7103a2ec08
child 4079 27b9cdc5233c
api update
web/test/data/schema.py
web/test/unittest_viewselector.py
--- a/web/test/data/schema.py	Wed Dec 09 12:52:21 2009 +0100
+++ b/web/test/data/schema.py	Wed Dec 09 12:52:30 2009 +0100
@@ -24,7 +24,7 @@
     subject = 'BlogEntry'
     object = 'CWUser'
     cardinality = '?*'
-    permissions = {
+    __permissions__ = {
         'add': ('managers',),
         'read': ('managers', 'users'),
         'delete': ('managers',),
--- a/web/test/unittest_viewselector.py	Wed Dec 09 12:52:21 2009 +0100
+++ b/web/test/unittest_viewselector.py	Wed Dec 09 12:52:30 2009 +0100
@@ -34,10 +34,11 @@
 class ViewSelectorTC(CubicWebTC):
 
     def setup_database(self):
-        self.add_entity('BlogEntry', title=u"une news !", content=u"cubicweb c'est beau")
-        self.add_entity('Bookmark', title=u"un signet !", path=u"view?vid=index")
-        self.add_entity('EmailAddress', address=u"devel@logilab.fr", alias=u'devel')
-        self.add_entity('Tag', name=u'x')
+        req = self.request()
+        req.create_entity('BlogEntry', title=u"une news !", content=u"cubicweb c'est beau")
+        req.create_entity('Bookmark', title=u"un signet !", path=u"view?vid=index")
+        req.create_entity('EmailAddress', address=u"devel@logilab.fr", alias=u'devel')
+        req.create_entity('Tag', name=u'x')
 
 class VRegistryTC(ViewSelectorTC):
     """test the view selector"""
@@ -390,7 +391,7 @@
                               tableview.TableView)
 
     def test_interface_selector(self):
-        image = self.add_entity('Image', data_name=u'bim.png', data=Binary('bim'))
+        image = self.request().create_entity('Image', data_name=u'bim.png', data=Binary('bim'))
         # image primary view priority
         req = self.request()
         rset = req.execute('Image X WHERE X data_name "bim.png"')
@@ -399,13 +400,13 @@
 
 
     def test_score_entity_selector(self):
-        image = self.add_entity('Image', data_name=u'bim.png', data=Binary('bim'))
+        image = self.request().create_entity('Image', data_name=u'bim.png', data=Binary('bim'))
         # image primary view priority
         req = self.request()
         rset = req.execute('Image X WHERE X data_name "bim.png"')
         self.assertIsInstance(self.vreg['views'].select('image', req, rset=rset),
                               idownloadable.ImageView)
-        fileobj = self.add_entity('File', data_name=u'bim.txt', data=Binary('bim'))
+        fileobj = self.request().create_entity('File', data_name=u'bim.txt', data=Binary('bim'))
         # image primary view priority
         req = self.request()
         rset = req.execute('File X WHERE X data_name "bim.txt"')