Created
September 30, 2018 06:01
-
-
Save joelburton/5d9e69bacf7f5c5b2ac98beeb26fb53d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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