Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created February 4, 2020 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/e630b92e8b4951611a6d03be670676cc to your computer and use it in GitHub Desktop.
Save Porter97/e630b92e8b4951611a6d03be670676cc to your computer and use it in GitHub Desktop.
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