def test_main(app):
# Add a greeting to find
guestbook.Greeting(
content='Hello world',
parent=ndb.Key('Book', 'brane3')).put()
# Add a greeting to not find.
guestbook.Greeting(
content='Flat sheet',
parent=ndb.Key('Book', 'brane2')).put()
response = app.get('/?guestbook_name=brane3')
assert response.status_int == 200
assert 'Hello world' in response.body
assert 'Flat sheet' not in response.body
评论列表
文章目录