Add basic and user model testing.

This commit is contained in:
Stephan Porada
2019-07-08 10:52:36 +02:00
parent 8e86e0a0e9
commit adec45989c
5 changed files with 59 additions and 2 deletions

22
tests/test_basics.py Normal file
View File

@ -0,0 +1,22 @@
import unittest
from flask import current_app
from app import create_app, db
class BasicsTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.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'])