Ejemplo n.º 1
0
def test_debug(app, client):
    app.debug = False
    app.testing = False

    production_response = client.post(
        '/widgets',
        content_type='text',
        data='foo',
    )
    assert_response(production_response, 400)
    assert 'debug' not in get_body(production_response)

    app.debug = True
    app.testing = False

    debug_response = client.post(
        '/widgets',
        content_type='text',
        data='foo',
    )
    assert_response(debug_response, 400)
    assert 'debug' in get_body(debug_response)

    app.debug = False
    app.testing = True

    testing_response = client.post(
        '/widgets',
        content_type='text',
        data='foo',
    )
    assert_response(testing_response, 400)
    assert 'debug' in get_body(testing_response)
Ejemplo n.º 2
0
def test_limit_offset_create(client):
    response = request(
        client,
        'POST', '/limit_offset_widgets',
        {
            'size': 1,
        },
    )

    assert 'meta' not in get_body(response)
Ejemplo n.º 3
0
def test_page_create(client):
    response = request(
        client,
        'POST', '/page_widgets',
        {
            'size': 1,
        },
    )

    assert 'meta' not in get_body(response)
Ejemplo n.º 4
0
def test_debug(app, client):
    app.debug = False
    app.testing = False

    production_response = client.post("/widgets",
                                      content_type="text",
                                      data="foo")
    assert_response(production_response, 400)
    assert "debug" not in get_body(production_response)

    app.debug = True
    app.testing = False

    debug_response = client.post("/widgets", content_type="text", data="foo")
    assert_response(debug_response, 400)
    assert "debug" in get_body(debug_response)

    app.debug = False
    app.testing = True

    testing_response = client.post("/widgets", content_type="text", data="foo")
    assert_response(testing_response, 400)
    assert "debug" in get_body(testing_response)
Ejemplo n.º 5
0
def test_page_create(client):
    response = client.post('/page_widgets', data={
        'size': 1,
    })

    assert 'meta' not in get_body(response)
Ejemplo n.º 6
0
def test_limit_offset_create(client):
    response = client.post('/limit_offset_widgets', data={
        'size': 1,
    })

    assert 'meta' not in get_body(response)
Ejemplo n.º 7
0
def test_page_create(client):
    response = client.post("/page_widgets", data={"size": 1})

    assert "meta" not in get_body(response)
Ejemplo n.º 8
0
def test_limit_offset_create(client):
    response = client.post("/limit_offset_widgets", data={"size": 1})

    assert "meta" not in get_body(response)