I found that webtest works pretty well. Doesn't require you to use config.scan() and just makes your app as per normal. https://docs.pylonsproject.org/projects/webtest/en/latest/
On Saturday, 11 August 2018 00:57:12 UTC+9:30, Gerhard Schmidt wrote: > > Hi, > > I'm writing a pyramid software using traversal with quite some complex > ways of finding views and testing permissions to the view. > > Everything works quite well in the running pyramid server but in > unit-tests the views that are there aren't found. > > I use the following code to get the callable of a view. > > adapters = registry.adapters > context_iface = providedBy(context) > view_callable = adapters.lookup( > (IViewClassifier, request.request_iface, context_iface), > IView, name=request.view_name, default=None) > > In the running server this code works fine, in unit-tests it returns > None all the time. > > I use a request object derived from pyramid.testing.DummyRequest. > > Can anybody give me a pointer what I'm doing wrong. > > Regards > Estartu > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/e5044aa0-fd77-41a1-861f-ddb0f40535f7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
