Beefed up the tutorial

This commit is contained in:
Armin Ronacher 2010-04-16 02:03:45 +02:00
parent 1246f4088a
commit 6dd92ae4b3
7 changed files with 306 additions and 92 deletions

View file

@ -33,6 +33,11 @@ class FlaskrTestCase(unittest.TestCase):
# testing functions
def test_empty_db(self):
"""Start with a blank database."""
rv = self.app.get('/')
assert 'No entries here so far' in rv.data
def test_login_logout(self):
"""Make sure login and logout works"""
rv = self.login(flaskr.USERNAME, flaskr.PASSWORD)
@ -46,9 +51,6 @@ class FlaskrTestCase(unittest.TestCase):
def test_messages(self):
"""Test that messages work"""
# start with a blank state
rv = self.app.get('/')
assert 'No entries here so far' in rv.data
self.login(flaskr.USERNAME, flaskr.PASSWORD)
rv = self.app.post('/add', data=dict(
title='<Hello>',