Merge with branch 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 11 Mar 2019 14:34:14 +0100
changeset 12491 540904e0ff0f
parent 12418 3eddb5954135 (current diff)
parent 12490 6311651c355f (diff)
child 12492 a7ffcaae7f4c
Merge with branch 3.26
cubicweb/__pkginfo__.py
cubicweb/pyramid/core.py
cubicweb/test/unittest_rset.py
doc/tutorials/base/blog-in-five-minutes.rst
flake8-ok-files.txt
requirements/test-web.txt
tox.ini
--- a/.hgtags	Tue Feb 26 16:28:17 2019 +0100
+++ b/.hgtags	Mon Mar 11 14:34:14 2019 +0100
@@ -631,3 +631,4 @@
 8362503a92482e74a674c78fe009cf6ff346c817 3.26.6
 8362503a92482e74a674c78fe009cf6ff346c817 debian/3.26.6-1
 ee4ad63c91e5406e29f079f1f2d3774361798ac8 3.26.7
+91f75319a726b523a09103540d3bc6872aaf2ae4 3.26.8
--- a/cubicweb/devtools/test/data/libpython/cubicweb_i18ntestcube/views.py	Tue Feb 26 16:28:17 2019 +0100
+++ b/cubicweb/devtools/test/data/libpython/cubicweb_i18ntestcube/views.py	Mon Mar 11 14:34:14 2019 +0100
@@ -21,10 +21,12 @@
 from cubicweb.web.views import primary, baseviews, uicfg
 from cubicweb.web.views.uicfg import autoform_section as afs
 
+
 class MyAFS(uicfg.AutoformSectionRelationTags):
     __select__ = is_instance('ForumThread')
 
-_myafs = MyAFS()
+
+_myafs = MyAFS(__module__=__name__)
 
 _myafs.tag_object_of(('*', 'in_forum', 'Forum'), 'main', 'inlined')
 
@@ -57,5 +59,6 @@
         _('Last answered')
         _('This forum does not have any thread yet.')
 
+
 class ForumThreadPrimaryView(primary.PrimaryView):
     __select__ = primary.PrimaryView.__select__ & is_instance('ForumThread')
--- a/cubicweb/ext/test/unittest_rest.py	Tue Feb 26 16:28:17 2019 +0100
+++ b/cubicweb/ext/test/unittest_rest.py	Mon Mar 11 14:34:14 2019 +0100
@@ -22,6 +22,7 @@
 
 from cubicweb.ext.rest import rest_publish
 
+
 class RestTC(CubicWebTC):
 
     def context(self, req):
@@ -31,10 +32,12 @@
         with self.admin_access.web_request() as req:
             context = self.context(req)
             self.assertEqual(rest_publish(context, ':eid:`%s`' % context.eid),
-                             '<p><a class="reference" href="http://testing.fr/cubicweb/cwuser/admin">'
+                             '<p><a class="reference"'
+                             ' href="http://testing.fr/cubicweb/cwuser/admin">'
                              '#%s</a></p>\n' % context.eid)
             self.assertEqual(rest_publish(context, ':eid:`%s:some text`' % context.eid),
-                             '<p><a class="reference" href="http://testing.fr/cubicweb/cwuser/admin">'
+                             '<p><a class="reference"'
+                             ' href="http://testing.fr/cubicweb/cwuser/admin">'
                              'some text</a></p>\n')
 
     def test_bad_rest_no_crash(self):
@@ -72,7 +75,8 @@
     def test_rql_role_with_vid(self):
         with self.admin_access.web_request() as req:
             context = self.context(req)
-            out = rest_publish(context, ':rql:`Any X ORDERBY XL WHERE X is CWUser, X login XL:table`')
+            out = rest_publish(context,
+                               ':rql:`Any X ORDERBY XL WHERE X is CWUser, X login XL:table`')
             self.assertTrue(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" '
                                          'title="">anon</a></td></tr>\n</tbody></table>'
                                          '</div></p>\n'))
@@ -89,7 +93,7 @@
             context = self.context(req)
             out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:toto`')
             self.assertTrue(out.startswith("<p>an error occurred while interpreting this "
-                                           "rql directive: ObjectNotFound(%s'toto',)</p>" %
+                                           "rql directive: ObjectNotFound(%s'toto'" %
                                            ('' if PY3 else 'u')),
                             out)
 
@@ -122,7 +126,7 @@
             out = rest_publish(context, """.. rql-table::""")
             self.assertIn("System Message: ERROR", out)
             self.assertIn("Content block expected for the &quot;rql-table&quot; "
-                          "directive; none found" , out)
+                          "directive; none found", out)
 
     def test_rqltable_norset(self):
         with self.admin_access.web_request() as req:
@@ -231,10 +235,11 @@
    :colvids: %(colvids)s
 
    %(rql)s
-                """ % {'rql': rql,
-                       'colvids': ', '.join(["%d=%s" % (k, v)
-                                             for k, v in colvids.items()])
-                   })
+                """
+                % {'rql': rql,
+                   'colvids': ', '.join(["%d=%s" % (k, v)
+                                         for k, v in colvids.items()])}
+            )
             view = self.vreg['views'].select('table', req, rset=req.execute(rql))
             view.cellvids = colvids
             self.assertEqual(view.render(w=None)[49:], out[49:])
--- a/cubicweb/pyramid/__init__.py	Tue Feb 26 16:28:17 2019 +0100
+++ b/cubicweb/pyramid/__init__.py	Mon Mar 11 14:34:14 2019 +0100
@@ -24,6 +24,7 @@
 import os
 import warnings
 
+from six.moves.configparser import SafeConfigParser
 import wsgicors
 
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
@@ -31,11 +32,6 @@
 from pyramid.exceptions import ConfigurationError
 from pyramid.settings import asbool, aslist
 
-try:
-    from configparser import SafeConfigParser
-except ImportError:
-    from ConfigParser import SafeConfigParser
-
 
 def config_from_cwconfig(cwconfig, settings=None):
     """Return a Pyramid Configurator instance built from a CubicWeb config and
--- a/flake8-ok-files.txt	Tue Feb 26 16:28:17 2019 +0100
+++ b/flake8-ok-files.txt	Mon Mar 11 14:34:14 2019 +0100
@@ -13,6 +13,7 @@
 cubicweb/dataimport/test/test_stores.py
 cubicweb/dataimport/test/unittest_importer.py
 cubicweb/devtools/test/data/cubes/i18ntestcube/__init__.py
+cubicweb/devtools/test/data/cubes/i18ntestcube/views.py
 cubicweb/devtools/test/data/cubes/__init__.py
 cubicweb/devtools/test/data/schema.py
 cubicweb/devtools/testlib.py
@@ -27,6 +28,7 @@
 cubicweb/etwist/request.py
 cubicweb/etwist/service.py
 cubicweb/ext/__init__.py
+cubicweb/ext/test/unittest_rest.py
 cubicweb/hooks/synccomputed.py
 cubicweb/hooks/syncsources.py
 cubicweb/hooks/test/data/hooks.py
--- a/requirements/test-server.txt	Tue Feb 26 16:28:17 2019 +0100
+++ b/requirements/test-server.txt	Mon Mar 11 14:34:14 2019 +0100
@@ -4,6 +4,6 @@
 cubicweb-basket
 cubicweb-card
 cubicweb-comment
-cubicweb-file
+cubicweb-file >= 2.2.2
 cubicweb-localperms
 cubicweb-tag