Пример #1
0
def test_get_messages_async(app, testbed):
    for i in range(21):
        account_key = guestbook.Account(nickname='Nick {}'.format(i)).put()
        guestbook.Message(author=account_key, text='Text {}'.format(i)).put()

    response = app.get('/messages?async=1')

    assert response.status_int == 200
    assert 'Nick 1 wrote:' in response.body
    assert '\nText 1' in response.body
Пример #2
0
def test_get_guestbook_async(app, testbed, login):
    guestbook.Account(id='123').put()
    # Log the user in
    login(id='123')
    for i in range(11):
        guestbook.Guestbook(content='Content {}'.format(i)).put()

    response = app.get('/guestbook?async=1')

    assert response.status_int == 200
    assert 'Content 1' in response.body
def test_get_messages_async(app, testbed):
    for i in range(21):
        account_key = guestbook.Account(nickname='Nick {}'.format(i)).put()
        guestbook.Message(author=account_key, text='Text {}'.format(i)).put()

    response = app.get('/messages?async=1')

    if response.status_int != 200:
        raise AssertionError
    if 'Nick 1 wrote:' not in response.body:
        raise AssertionError
    if '\nText 1' not in response.body:
        raise AssertionError
def test_get_guestbook_async(app, testbed, login):
    guestbook.Account(id='123').put()
    # Log the user in
    login(id='123')
    for i in range(11):
        guestbook.Guestbook(content='Content {}'.format(i)).put()

    response = app.get('/guestbook?async=1')

    if response.status_int != 200:
        raise AssertionError
    if 'Content 1' not in response.body:
        raise AssertionError