refactored app structure

This commit is contained in:
Bryan Bailey
2022-04-05 23:12:42 -04:00
parent 56b4ec2670
commit 5ca91452ca
23 changed files with 317 additions and 138 deletions

0
tests/__init__.py Normal file
View File

24
tests/test_web.py Normal file
View File

@@ -0,0 +1,24 @@
import unittest
from flask import current_app
from app import create_app, db
class BasicTestCase(unittest.TestCase):
def setUp(self) -> None:
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_context.push()
db.create_all()
def tearDown(self) -> None:
db.session.remove()
db.drop_all()
self.app_context.pop()
def test_app_exists(self):
self.assertFalse(current_app is None)
def test_app_is_testing(self):
self.assertTrue(current_app.config['TESTING'])