Skip to content

Instantly share code, notes, and snippets.

@jinhoyoo
Last active November 24, 2015 08:34
Show Gist options
  • Save jinhoyoo/eab54220e406bbc828c2 to your computer and use it in GitHub Desktop.
Save jinhoyoo/eab54220e406bbc828c2 to your computer and use it in GitHub Desktop.
Example: Flask test with unittest
import os
from datalibs import app
import unittest
class AppViewTestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.app = app.test_client()
def tearDown(self):
pass
def test_first_page(self):
rv = self.app.get('/login')
print rv.data
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment