| 731 | self.assertIn("<p>You selected 9</p>", display, display) |
| 732 | |
| 733 | def test_select_no_value(self): |
| 734 | app = webtest.TestApp(select_app_without_values) |
| 735 | res = app.get('/') |
| 736 | self.assertEqual(res.status_int, 200) |
| 737 | self.assertEqual(res.headers['content-type'], |
| 738 | 'text/html; charset=utf-8') |
| 739 | self.assertEqual(res.content_type, 'text/html') |
| 740 | |
| 741 | single_form = res.forms["single_select_form"] |
| 742 | self.assertEqual(single_form["single"].value, "Four") |
| 743 | display = single_form.submit("button") |
| 744 | self.assertIn("<p>You selected Four</p>", display, display) |
| 745 | |
| 746 | res = app.get('/') |
| 747 | self.assertEqual(res.status_int, 200) |
| 748 | self.assertEqual(res.headers['content-type'], |
| 749 | 'text/html; charset=utf-8') |
| 750 | self.assertEqual(res.content_type, 'text/html') |
| 751 | |
| 752 | single_form = res.forms["single_select_form"] |
| 753 | self.assertEqual(single_form["single"].value, "Four") |
| 754 | single_form.set("single", "Six") |
| 755 | self.assertEqual(single_form["single"].value, "Six") |
| 756 | display = single_form.submit("button") |
| 757 | self.assertIn("<p>You selected Six</p>", display, display) |
| 758 | |
| 759 | def test_multiple_select_no_value(self): |
| 760 | app = webtest.TestApp(select_app_without_values) |