# HG changeset patch # User Aurelien Campeas # Date 1401718686 -7200 # Node ID 37931aaebcfc879eecf8e83c3ada1708115a5960 # Parent 1b864f5541cfb7d6f30ba7a34179474f533f1c23 [webtest/pyviews] use the new connection api diff -r 1b864f5541cf -r 37931aaebcfc web/test/unittest_views_pyviews.py --- a/web/test/unittest_views_pyviews.py Mon Jun 02 16:13:33 2014 +0200 +++ b/web/test/unittest_views_pyviews.py Mon Jun 02 16:18:06 2014 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -21,20 +21,22 @@ class PyViewsTC(CubicWebTC): def test_pyvaltable(self): - view = self.vreg['views'].select('pyvaltable', self.request(), - pyvalue=[[1, 'a'], [2, 'b']]) - content = view.render(pyvalue=[[1, 'a'], [2, 'b']], - headers=['num', 'char']) - self.assertEqual(content.strip(), '''\ + with self.admin_access.web_request() as req: + view = self.vreg['views'].select('pyvaltable', req, + pyvalue=[[1, 'a'], [2, 'b']]) + content = view.render(pyvalue=[[1, 'a'], [2, 'b']], + headers=['num', 'char']) + self.assertEqual(content.strip(), '''
\
1a
2b
''') def test_pyvallist(self): - view = self.vreg['views'].select('pyvallist', self.request(), - pyvalue=[1, 'a']) - content = view.render(pyvalue=[1, 'a']) - self.assertEqual(content.strip(), '''