Archive - Originally posted on "The Horse's Mouth" - 2015-10-15 13:14:52 - Graham Ellis
Moving on from the single file "Hello Flask Test World" at [here], I've now uploaded an example that takes a Flask application including a form - it's [here] and based on our earlier form demo and runs it through unit test [here].
It runs with all tests passing:
WomanWithCat:flask grahamellis$ python flask_app_test
test_filled_page_1 (__main__.FlaskClientTestCase) ... ok
test_filled_page_2 (__main__.FlaskClientTestCase) ... ok
test_home_page_1 (__main__.FlaskClientTestCase) ... ok
test_home_page_2 (__main__.FlaskClientTestCase) ... ok
----------------------------------------------------------------------
Ran 4 tests in 0.028s
OK
WomanWithCat:flask grahamellis$
Note the need to configure the app to turn off cross site scripting checking ... the rest is relatively straightforward, just the need to get it all right. Ask me if you need an explanation - better still pop along to Melksham for the day and I can sort it for you ;-).