예제 #1
0
    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}
        )
예제 #2
0
파일: form_test.py 프로젝트: jayzhen521/h
    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))
예제 #3
0
파일: form_test.py 프로젝트: gnott/h
    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))
예제 #4
0
    def test_returns_form_object(self, Form, pyramid_request):
        result = form.create_form(pyramid_request, mock.sentinel.schema)

        assert result == Form.return_value