WebTest doesn't like Pyramid NotFound rendering

27 views
Skip to first unread message

Chris Withers

unread,
Mar 1, 2011, 11:56:07 AM3/1/11
to pylons...@googlegroups.com
Hi All,

I have a view that raises a NotFound if it can't find the model it's
trying to render.

I have a functional test for this that uses WebTest along the lines of:

def test_not_there(self):
self.testapp.get('/not_there', status=404)

This results in the following barf from WebTest:

self.testapp.get('/not_there', status=404)
File "build/bdist.linux-i686/egg/webtest/__init__.py", line 156, in get
File "build/bdist.linux-i686/egg/webtest/__init__.py", line 378, in
do_request
File
"/home/chris/buildout-eggs/WebOb-1.0.1-py2.6.egg/webob/response.py",
line 278, in _body__get
body = self._body = ''.join(self._app_iter)
File "build/bdist.linux-i686/egg/webtest/lint.py", line 272, in next
AssertionError: Iterator <listiterator object at 0xa930f6c> returned a
non-str object: u'\n <html>\n <title>404 Not
Found</title>\n <body>\n <h1>404 Not
Found</h1>\n <code>not_there</code>\n </body>\n
</html>\n

So, looks like WebTest is complaining about the unicode object returned
here. But, who's in the wrong? Pyramid or WebTest?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk

Reply all
Reply to author
Forward
0 new messages