diff options
| author | Stéphane Klein <sklein@bearstech.com> | 2013-02-22 11:02:25 +0100 |
|---|---|---|
| committer | Stéphane Klein <sklein@bearstech.com> | 2013-02-22 11:46:47 +0100 |
| commit | 132454709bffb15ac82730cede7ef88d16a23e6a (patch) | |
| tree | f04335c87be18e4f61e940f81ae336e44e192fca /tests | |
| parent | 4519c52260e91354f5c535a8dedfa06af3d26360 (diff) | |
| download | webtest-132454709bffb15ac82730cede7ef88d16a23e6a.tar.gz | |
Create a new test response file
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_response.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_response.py b/tests/test_response.py new file mode 100644 index 0000000..8160bb1 --- /dev/null +++ b/tests/test_response.py @@ -0,0 +1,16 @@ +import webtest +from webtest.debugapp import debug_app + +from tests.compat import unittest + + +class TestResponse(unittest.TestCase): + def setUp(self): + self.app = webtest.TestApp(debug_app) + + def test_mustcontains(self): + res = self.app.post('/', params='foobar') + res.mustcontain('foobar') + self.assertRaises(IndexError, res.mustcontain, 'not found') + res.mustcontain('foobar', no='not found') + self.assertRaises(IndexError, res.mustcontain, no='foobar') |
