"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ZPublisher/tests/test_WSGIPublisher.py" between
Zope-5.1.1.tar.gz and Zope-5.1.2.tar.gz

About: Zope Z Object Publishing Environment - web application platform used for building content management systems, intranets, portals, and custom applications.

test_WSGIPublisher.py  (Zope-5.1.1):test_WSGIPublisher.py  (Zope-5.1.2)
skipping to change at line 915 skipping to change at line 915
class WSGIPublisherTests(FunctionalTestCase): class WSGIPublisherTests(FunctionalTestCase):
def test_can_handle_non_ascii_URLs(self): def test_can_handle_non_ascii_URLs(self):
from OFS.Image import manage_addFile from OFS.Image import manage_addFile
manage_addFile(self.app, 'täst', 'çöńtêñt'.encode()) manage_addFile(self.app, 'täst', 'çöńtêñt'.encode())
browser = Testing.testbrowser.Browser() browser = Testing.testbrowser.Browser()
browser.login('manager', 'manager_pass') browser.login('manager', 'manager_pass')
browser.open('http://localhost/{}'.format(quote('täst'))) browser.open(f'http://localhost/{quote("täst")}')
self.assertEqual(browser.contents.decode('utf-8'), 'çöńtêñt') self.assertEqual(browser.contents.decode('utf-8'), 'çöńtêñt')
class TestLoadApp(unittest.TestCase): class TestLoadApp(unittest.TestCase):
def _getTarget(self): def _getTarget(self):
from ZPublisher.WSGIPublisher import load_app from ZPublisher.WSGIPublisher import load_app
return load_app return load_app
def _makeModuleInfo(self): def _makeModuleInfo(self):
class Connection: class Connection:
skipping to change at line 984 skipping to change at line 984
self.assertEqual(counter.counts(), (1, 1)) self.assertEqual(counter.counts(), (1, 1))
class CustomExceptionView: class CustomExceptionView:
def __init__(self, context, request): def __init__(self, context, request):
self.context = context self.context = context
self.__parent__ = None self.__parent__ = None
self.request = request self.request = request
def __call__(self): def __call__(self):
return ('Exception View: {}\nContext: {}'.format( return (
self.context.__class__.__name__, f'Exception View: {self.context.__class__.__name__}\n'
self.__parent__.__class__.__name__)) f'Context: {self.__parent__.__class__.__name__}')
def registerExceptionView(for_, factory=CustomExceptionView, def registerExceptionView(for_, factory=CustomExceptionView,
name='index.html'): name='index.html'):
from zope.component import getGlobalSiteManager from zope.component import getGlobalSiteManager
from zope.interface import Interface from zope.interface import Interface
from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.publisher.interfaces.browser import IDefaultBrowserLayer
gsm = getGlobalSiteManager() gsm = getGlobalSiteManager()
gsm.registerAdapter( gsm.registerAdapter(
factory, factory,
required=(for_, IDefaultBrowserLayer), required=(for_, IDefaultBrowserLayer),
 End of changes. 2 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)