No Description
python
flask

test_basics.py 562B

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