24 lines
620 B
Python
24 lines
620 B
Python
import unittest
|
|
from flask import current_app
|
|
from dash import create_app, db
|
|
|
|
class BasicsTestCase(unittest.TestCase):
|
|
def setUp(self):
|
|
self.dash = create_app('testing')
|
|
self.app_context = self.dash.app_context()
|
|
self.app_context.push()
|
|
db.create_all()
|
|
|
|
def tearDown(self):
|
|
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'])
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main() |