From 0b69a32b7cc758feba0ad9278dea2ff6827edf97 Mon Sep 17 00:00:00 2001 From: Hanno Schlichting Date: Sat, 27 May 2017 13:02:43 +0200 Subject: [PATCH] Require latest Zope release, adding charset to content type headers. --- setup.py | 6 +++-- src/ZServer/tests/test_responses.py | 34 +++++++++++++++-------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index d079e4d..0e3cb17 100644 --- a/setup.py +++ b/setup.py @@ -14,9 +14,11 @@ from setuptools import setup, find_packages +__version__ = '4.0a3.dev0' + setup( name='ZServer', - version='4.0a3.dev0', + version=__version__, url='https://pypi.python.org/pypi/ZServer', license='ZPL 2.1', description="Zope 2 ZServer.", @@ -58,7 +60,7 @@ 'zope.processlifetime', 'zope.schema', 'zope.testing', - 'Zope2 >= 4.0a2', + 'Zope2 >= 4.0a5', ], include_package_data=True, zip_safe=False, diff --git a/src/ZServer/tests/test_responses.py b/src/ZServer/tests/test_responses.py index 3cfb1b3..c8c11ee 100644 --- a/src/ZServer/tests/test_responses.py +++ b/src/ZServer/tests/test_responses.py @@ -231,14 +231,15 @@ def test_contentLength(self): response._http_connection = 'keep-alive' response.body = '123456789' response.setHeader('Content-Type', 'text/plain') - self._assertResponsesAreEqual(str(response), - ('HTTP/1.1 200 OK', - 'Content-Length: 9', - 'Content-Type: text/plain', - 'Date: ...', - 'Server: ...', - '', - '123456789')) + self._assertResponsesAreEqual( + str(response), + ('HTTP/1.1 200 OK', + 'Content-Length: 9', + 'Content-Type: text/plain; charset=utf-8', + 'Date: ...', + 'Server: ...', + '', + '123456789')) def test_emptyBody(self): # Check that a response with an empty message body returns a @@ -264,14 +265,15 @@ def test_HEAD(self): response._http_connection = 'keep-alive' response.setHeader('Content-Type', 'text/plain') response.setHeader('Content-Length', 123) - self._assertResponsesAreEqual(str(response), - ('HTTP/1.1 200 OK', - 'Content-Length: 123', - 'Content-Type: text/plain', - 'Date: ...', - 'Server: ...', - '', - '')) + self._assertResponsesAreEqual( + str(response), + ('HTTP/1.1 200 OK', + 'Content-Length: 123', + 'Content-Type: text/plain; charset=utf-8', + 'Date: ...', + 'Server: ...', + '', + '')) def test_uses_accumulated_headers_correctly(self): response = self._makeOne()