예제 #1
0
파일: views_test.py 프로젝트: chrber/h
def test_create_form_creates_form_with_GroupSchema(GroupSchema, Form):
    test_schema = mock.Mock()
    GroupSchema.return_value = mock.Mock(bind=mock.Mock(return_value=test_schema))

    views.create_form(request=_mock_request())

    assert Form.call_args[0][0] == test_schema
예제 #2
0
def test_create_form_creates_form_with_GroupSchema(GroupSchema, Form):
    test_schema = mock.Mock()
    GroupSchema.return_value = mock.Mock(
        bind=mock.Mock(return_value=test_schema))

    views.create_form(request=_mock_request())

    assert Form.call_args[0][0] == test_schema
예제 #3
0
파일: views_test.py 프로젝트: plainspace/h
def test_create_form_creates_form_with_GroupSchema(GroupSchema, Form):
    test_schema = mock.Mock()
    GroupSchema.return_value = mock.Mock(
        bind=mock.Mock(return_value=test_schema))

    views.create_form(request=_mock_request())

    Form.assert_called_once_with(test_schema)
예제 #4
0
파일: views_test.py 프로젝트: ningyifan/h
def test_create_form_creates_form_with_GroupSchema(GroupSchema, Form):
    test_schema = mock.Mock()
    GroupSchema.return_value = mock.Mock(
        bind=mock.Mock(return_value=test_schema))

    views.create_form(request=_mock_request())

    Form.assert_called_once_with(test_schema)
예제 #5
0
def test_create_form_returns_form(Form):
    test_form = mock.Mock()
    Form.return_value = test_form

    result = views.create_form(request=_mock_request())

    assert result["form"] == test_form.render.return_value
예제 #6
0
파일: views_test.py 프로젝트: plainspace/h
def test_create_form_returns_empty_form_data(Form):
    test_form = mock.Mock()
    Form.return_value = test_form

    template_data = views.create_form(request=_mock_request())

    assert template_data["data"] == {}
예제 #7
0
파일: views_test.py 프로젝트: ningyifan/h
def test_create_form_returns_empty_form_data(Form):
    test_form = mock.Mock()
    Form.return_value = test_form

    template_data = views.create_form(request=_mock_request())

    assert template_data["data"] == {}
예제 #8
0
파일: views_test.py 프로젝트: plainspace/h
def test_create_form_404s_if_groups_feature_is_off():
    with pytest.raises(httpexceptions.HTTPNotFound):
        views.create_form(_mock_request(feature=lambda feature: False))
예제 #9
0
파일: views_test.py 프로젝트: ningyifan/h
def test_create_form_404s_if_groups_feature_is_off():
    with pytest.raises(httpexceptions.HTTPNotFound):
        views.create_form(_mock_request(feature=lambda feature: False))