Previous topic

helpers module

Next topic

settings module

This Page

testing module

More useful TestCase for tests.

Simple basic TestCase for your tests. Note, that nose test runner is used (it’s really good):

(flaskit)MacBook-Pro-Roman:flaskit semirook$ nosetests
...
----------------------------------------------------------------------
Ran 3 tests in 0.476s

OK
copyright:(c) 2012 by Roman Semirook.
license:BSD, see LICENSE for more details.
class testing.KitTestCase(methodName='runTest')[source]

Bases: flask_testing.utils.TestCase

assertContains(response, text, count=None, status_code=200, msg_prefix='')[source]

Asserts that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected), and that text occurs count times in the content of the response. If count is None, the count doesn’t matter - the assertion is true if the text occurs at least once in the response.

create_app()[source]
setUp()[source]
tearDown()[source]