MCPcopy Index your code
hub / github.com/realpython/discover-flask / BaseTestCase

Class BaseTestCase

tests/base.py:7–23  ·  view source on GitHub ↗

A base test case.

Source from the content-addressed store, hash-verified

5
6
7class BaseTestCase(TestCase):
8 """A base test case."""
9
10 def create_app(self):
11 app.config.from_object('config.TestConfig')
12 return app
13
14 def setUp(self):
15 db.create_all()
16 db.session.add(User("admin", "ad@min.com", "admin"))
17 db.session.add(
18 BlogPost("Test post", "This is a test. Only a test.", "admin"))
19 db.session.commit()
20
21 def tearDown(self):
22 db.session.remove()
23 db.drop_all()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected