test_basic.py 584 B

12345678910111213141516171819202122
  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_exits(self):
  15. self.assertFalse(current_app is None)
  16. def test_app_is_testing(self):
  17. self.assertFalse(current_app.config['TESTING'])