You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
537 B
20 lines
537 B
11 years ago
|
# -*- coding: utf-8 -*-
|
||
|
from flask.ext.testing import TestCase
|
||
11 years ago
|
from {{ cookiecutter.app_name }}.settings import TestConfig
|
||
11 years ago
|
from {{ cookiecutter.app_name }}.app import create_app
|
||
|
from {{ cookiecutter.app_name }}.database import db
|
||
11 years ago
|
|
||
|
|
||
|
class DbTestCase(TestCase):
|
||
|
"""Base TestCase for tests that require a database."""
|
||
|
|
||
|
def create_app(self):
|
||
|
app = create_app(TestConfig)
|
||
|
with app.app_context():
|
||
|
db.create_all()
|
||
|
return app
|
||
|
|
||
|
def tearDown(self):
|
||
|
db.session.remove()
|
||
|
db.drop_all()
|