Skip to content

Commit

Permalink
Fixed absoluteURL related test bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Jan 12, 2005
1 parent 15cee6e commit 4a3da44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions browser/tests/test_adding.py
Expand Up @@ -31,6 +31,7 @@
from zope.app.testing import ztapi
from zope.app.testing.placelesssetup import PlacelessSetup, setUp, tearDown
from zope.app.traversing.browser import AbsoluteURL
from zope.app.traversing.browser.interfaces import IAbsoluteURL
from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.exception.interfaces import UserError
from zope.app.publisher.browser import BrowserView
Expand Down Expand Up @@ -84,6 +85,8 @@ def __str__(self):
url += '/' + name
return url

__call__ = __str__

def defineMenuItem(menuItemType, for_, action, title=u'', extra=None):
newclass = type(title, (BrowserMenuItem,),
{'title':title, 'action':action,
Expand Down Expand Up @@ -182,6 +185,7 @@ def test_action(self):
adding.__name__ = '+'
ztapi.browserView(IAdding, "Thing", CreationView)
ztapi.browserView(Interface, "absolute_url", AbsoluteURL)
ztapi.browserView(None, '', AbsoluteURL, providing=IAbsoluteURL)
self.assertRaises(UserError, adding.action, '', 'foo')
adding.action('Thing', 'foo')
self.assertEqual(adding.request.response._headers['location'],
Expand Down

0 comments on commit 4a3da44

Please sign in to comment.