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.

25 regels
679 B

4 jaren geleden
  1. # -*- coding: utf-8 -*-
  2. """
  3. :author: Grey Li ()
  4. :url: http://greyli.com
  5. :copyright: © 2018 Grey Li <withlihui@gmail.com>
  6. :license: MIT, see LICENSE for more details.
  7. """
  8. from flask import current_app
  9. from tests.base import BaseTestCase
  10. class BasicTestCase(BaseTestCase):
  11. def test_app_exist(self):
  12. self.assertFalse(current_app is None)
  13. def test_app_is_testing(self):
  14. self.assertTrue(current_app.config['TESTING'])
  15. def test_404_error(self):
  16. response = self.client.get('/foo')
  17. data = response.get_data(as_text=True)
  18. self.assertEqual(response.status_code, 404)
  19. self.assertIn('404 Error', data)