Skip to content

Instantly share code, notes, and snippets.

@joelburton
Created September 30, 2018 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelburton/5d9e69bacf7f5c5b2ac98beeb26fb53d to your computer and use it in GitHub Desktop.
Save joelburton/5d9e69bacf7f5c5b2ac98beeb26fb53d to your computer and use it in GitHub Desktop.
from app import app
from unittest import TestCase
class MadlibsTestCase(TestCase):
def setUp(self):
self.client = app.test_client()
def test_questions(self):
resp = self.client.get("/")
body = resp.get_data(as_text=True)
self.assertEqual(resp.status_code, 200)
self.assertIn("<button>", body)
def test_story(self):
qs = {"place": "Panama"}
resp = self.client.get("/story", query_string=qs)
body = resp.get_data(as_text=True)
self.assertEqual(resp.status_code, 200)
self.assertIn("in a long-ago Panama", body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment