def test_adds_feature_client_to_system_context(self, Form, patch, pyramid_request): Jinja2Renderer = patch("h.form.Jinja2Renderer") form.create_form(pyramid_request, mock.sentinel.schema) Jinja2Renderer.assert_called_once_with( mock.sentinel.jinja2_env, {"feature": pyramid_request.feature} )
def test_passes_args_including_renderer_to_form_ctor( self, Form, matchers, pyramid_request): form.create_form(pyramid_request, mock.sentinel.schema, foo='bar') Form.assert_called_once_with(mock.sentinel.schema, foo='bar', renderer=matchers.instance_of( form.Jinja2Renderer))
def test_passes_args_including_renderer_to_form_ctor(self, Form, matchers, pyramid_request): form.create_form(pyramid_request, mock.sentinel.schema, foo='bar') Form.assert_called_once_with(mock.sentinel.schema, foo='bar', renderer=matchers.instance_of(form.Jinja2Renderer))
def test_returns_form_object(self, Form, pyramid_request): result = form.create_form(pyramid_request, mock.sentinel.schema) assert result == Form.return_value