Created
February 4, 2020 19:12
-
-
Save Porter97/e630b92e8b4951611a6d03be670676cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment