Hi
I try to use Pyramid, routes + sqlalchemy.
And, I wrote unittest with pyramid.configuration:Configurator.
My model uses `route_url`, and call `add_route` in TestCase.setUp.
I got error below::
Traceback (most recent call last):
File
"/Users/aodag/.buildout/eggs/unittest2-0.5.1-py2.6.egg/unittest2/case.py",
line 340, in run
testMethod()
File
"/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/tests.py",
line 34, in test_to_dict
dct = target.to_dict()
File
"/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/models.py",
line 42, in to_dict
for t in self.tickets])
File
"/Users/aodag/works/aodag.app.tracker/src/aodag/app/tracker/ticket/models.py",
line 71, in url
issue_no=self.issue_no)
File "/Users/aodag/.buildout/eggs/pyramid-1.0a2-py2.6.egg/pyramid/url.py",
line 110, in route_url
mapper = reg.getUtility(IRoutesMapper)
File
"/Users/aodag/.buildout/eggs/zope.component-3.10.0-py2.6.egg/zope/component/registry.py",
line 168, in getUtility
raise ComponentLookupError(provided, name)
ComponentLookupError: (<InterfaceClass pyramid.interfaces.IRoutesMapper>, u'')
Why was not IRoutesMapper found?
I tried again with trick in TestCase.setUp::
get_current_request().registry = get_current_registry()
That's OK.
But, `route_url` also uses `get_current_registry`.
Why does the strange error happend?
--
/*
Atsushi Odagiri
http://blog.aodag.jp
mailto:[email protected]
*/
--
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.