Example #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)
def test_limit_offset_create(client):
    response = request(
        client,
        'POST', '/limit_offset_widgets',
        {
            'size': 1,
        },
    )

    assert 'meta' not in get_body(response)
def test_page_create(client):
    response = request(
        client,
        'POST', '/page_widgets',
        {
            'size': 1,
        },
    )

    assert 'meta' not in get_body(response)
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)
Example #5
0
def test_page_create(client):
    response = client.post('/page_widgets', data={
        'size': 1,
    })

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

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

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

    assert "meta" not in get_body(response)