pecan/pecan — Issue #28: Pecan has broken tests with WebOb 1.2b2
Author: alfredodeza
Created: 2011-11-08 18:47:54+00:00
State: open

Doing `python setup.py develop` and running tests breaks:

$ py.test
========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 2.6.1 -- pytest-2.1.3
collected 112 items / 1 errors

tests/test_base.py ...............F............
tests/test_conf.py .................
tests/test_deploy.py ....
tests/test_generic.py .
tests/test_hooks.py ...................
tests/test_rest.py ........
tests/test_secure.py ...................
tests/test_static.py .
tests/test_templating.py .....
tests/test_util.py .
tests/test_validation.py .........

================================================================================================= ERRORS =================================================================================================
_________________________________________________________________________________ ERROR collecting tests/test_jsonify.py _________________________________________________________________________________
tests/test_jsonify.py:17: in
> from webob.multidict import MultiDict, UnicodeMultiDict
E ImportError: cannot import name UnicodeMultiDict
================================================================================================ FAILURES ================================================================================================
_____________________________________________________________________________________ TestBase.test_x_forward_proto ______________________________________________________________________________________

self =

def test_x_forward_proto(self):
class ChildController(object):
@expose()
def index(self):
redirect('/testing')
class RootController(object):
@expose()
def index(self):
redirect('/testing')
@expose()
def testing(self):
return 'it worked!'
child = ChildController()

app = TestApp(make_app(RootController(), debug=True))
response = app.get('/child', extra_environ=dict(HTTP_X_FORWARDED_PROTO='https'))
##non-canonical url will redirect, so we won't get a 301
assert response.status_int == 302
##should add trailing / and changes location to https
assert response.location == 'https://localhost/child/'
> assert response.environ['HTTP_X_FORWARDED_PROTO'] == 'https'
E TypeError: 'NoneType' object is unsubscriptable

tests/test_base.py:605: TypeError