Add another flask exercise

This commit is contained in:
abregman
2020-01-16 23:50:49 +02:00
parent 24edb687e4
commit 85d8a566d1
10 changed files with 201 additions and 57 deletions

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# coding=utf-8
import os
import unittest
from config import basedir
from app import app
from app import db
class TestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(
basedir, 'test.db')
self.app = app.test_client()
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()
if __name__ == '__main__':
unittest.main()