def test_it(self): from zope.interface import providedBy from pyramid_layout.interfaces import ILayout from pyramid_layout.layout import find_layout request = mock.Mock() lookup = request.registry.adapters.lookup Layout = lookup.return_value find_layout('context', request, 'test') Layout.assert_called_once_with('context', request) lookup.assert_called_once_with( (providedBy('context'),), ILayout, name='test')
def test_layout_none(self): from pyramid_layout.interfaces import ILayout from pyramid_layout.layout import find_layout request = testing.DummyRequest() self.assertEqual(find_layout('context', request, 'test'), None)