Hi,
I'm trying to test one of my models where there's a particular query
I decorated with beaker_cache. It's failing with the classic
"TypeError: No object (name: app_globals) has been registered for this
thread" so, as per the docs, I tried to define app_globals in my test
file:
from pylons.configuration import PylonsConfig
from webtest import TestApp
...
app = TestApp(PylonsConfig)
response = app.get('/_test_vars')
app_globals = response.app_globals
...
However this action generates the following error that looks easy
enough but I cannot really find out how to fix it:
TypeError (dict expected at most 1 arguments, got 2). Can somebody
suggest a way to fix it? (I'm using Pylons 1.0)
Here's the full trace:
======================================================================
ERROR: Failure: TypeError (dict expected at most 1 arguments, got 2)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mariano/Sandbox/insite/lib/python2.6/site-packages/
nose-0.11.3-py2.6.egg/nose/loader.py", line 382, in loadTestsFromName
addr.filename, addr.module)
File "/home/mariano/Sandbox/insite/lib/python2.6/site-packages/
nose-0.11.3-py2.6.egg/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/mariano/Sandbox/insite/lib/python2.6/site-packages/
nose-0.11.3-py2.6.egg/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/mariano/Code/insite/dev/insite/insite/tests/
test_3model_qa.py", line 13, in <module>
response = app.get('/_test_vars')
File "build/bdist.linux-i686/egg/webtest/__init__.py", line 153, in
get
expect_errors=expect_errors)
File "build/bdist.linux-i686/egg/webtest/__init__.py", line 310, in
do_request
res = req.get_response(app, catch_exc_info=True)
File "build/bdist.linux-i686/egg/webob/request.py", line 915, in
get_response
application, catch_exc_info=True)
File "build/bdist.linux-i686/egg/webob/request.py", line 887, in
call_application
app_iter = application(self.environ, start_response)
File "build/bdist.linux-i686/egg/webtest/lint.py", line 170, in
lint_app
iterator = application(environ, start_response_wrapper)
TypeError: dict expected at most 1 arguments, got 2
TIA,
Mariano
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.