web/test/unittest_views_baseviews.py
changeset 4083 3b285889b8e9
parent 3777 3ef8cdb5fb1c
child 4252 6c4f109c2b03
--- a/web/test/unittest_views_baseviews.py	Wed Dec 09 15:19:48 2009 +0100
+++ b/web/test/unittest_views_baseviews.py	Wed Dec 09 15:47:01 2009 +0100
@@ -87,10 +87,10 @@
 class TableViewTC(CubicWebTC):
 
     def _prepare_entity(self):
-        e = self.add_entity("State", name=u'<toto>', description=u'loo"ong blabla')
-        rset = self.execute('Any X, D, CD, NOW - CD WHERE X is State, X description D, X creation_date CD, X eid %(x)s',
+        req = self.request()
+        e = req.create_entity("State", name=u'<toto>', description=u'loo"ong blabla')
+        rset = req.execute('Any X, D, CD, NOW - CD WHERE X is State, X description D, X creation_date CD, X eid %(x)s',
                             {'x': e.eid}, 'x')
-        req = self.request()
         view = self.vreg['views'].select('table', req, rset=rset)
         return e, rset, view