You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
562 B

  1. import unittest
  2. from flask import current_app
  3. from app import create_app, db
  4. class BasicTestCase(unittest.TestCase):
  5. def setUp(self):
  6. self.app = create_app('testing')
  7. self.app_context = self.app.app_context()
  8. self.app_context.push()
  9. db.create_all()
  10. def tearDown(self):
  11. db.session.remove()
  12. db.drop_all()
  13. self.app_context.pop()
  14. def test_app_exists(self):
  15. self.assertFalse(current_app is None)
  16. def test_app_is_testing(self):
  17. self.assertTrue(current_app.config['TESTING'])