Commit f82cc051 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Fix patches, break in test mode

It seems that in test mode, monkey patch is done after cubicweb.web.views.forms
has been loaded, which hence references the original guess_field (monkey-patched
by cube'site_cubicweb).

Using the proper module fixes the problem.
parent fa0a0bb2da4b
...@@ -38,6 +38,7 @@ def _build_form(*args, **kwargs): ...@@ -38,6 +38,7 @@ def _build_form(*args, **kwargs):
# (https://www.cubicweb.org/ticket/14474840) # (https://www.cubicweb.org/ticket/14474840)
# other part in site_cubicweb # other part in site_cubicweb
from cubicweb.web import formfields # noqa
from cubicweb.web.views import forms # noqa from cubicweb.web.views import forms # noqa
...@@ -70,7 +71,7 @@ def field_by_name(cls_or_self, name, role=None, eschema=None): ...@@ -70,7 +71,7 @@ def field_by_name(cls_or_self, name, role=None, eschema=None):
req = None req = None
else: else:
req = cls_or_self._cw req = cls_or_self._cw
field = forms.guess_field(eschema, rschema, role, req=req, eidparam=True, **kwargs) field = formfields.guess_field(eschema, rschema, role, req=req, eidparam=True, **kwargs)
if field is None: if field is None:
raise raise
return field return field
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment