I need to test a method called addServerUrl() using the command "bin/test -t addServerUrl()" in terminal
addServerUrl contains the following code:
def addServerUrl(self,html_src,prefix):
url = getToolByName(self.context, "portal_url")
temp = html_src.replace('href="mailto:', '$XXX$')
temp = temp.replace('href="', 'href="%s/%s' % (url, prefix))
return temp.replace('$XXX$', 'href="mailto:')
when run "bin/test -t addServerUrl()" in terminal i m getting the following error
File "/home/oomsys/brundelre3/src/bdr.theme/src/bdr/theme/browser/createPictMenu.py", line 159, in addServerUrl
url = getToolByName(self.context, "portal_url")()
File "<string>", line 10, in check_getToolByName
File "/home/oomsys/brundelre3/eggs/Products.CMFCore-2.2.7-py2.7.egg/Products/CMFCore/utils.py", line 120, in getToolByName
raise AttributeError, name
AttributeError: portal_url
Why am getting error in "url"??? Any one pls help soon.