I have a Flask route that looks like this:
@app.route(\'/\')
def home():
My suggestion would be to take a look at the Flask documentation for testing.
Using the docs as a guide you should be able to set up a test case that can check the contents of the response.
import unittest
import yourappname
class MyAppTestCase(unittest.TestCase):
def setUp(self):
self.app = yourappname.app.test_client()
def test_greeting(self):
rv = self.app.get('/')
self.assertIn('hello', rv.data)
where yourappname is the name of your app/project.