Hello community,

here is the log from the commit of package python-WebTest for openSUSE:Factory 
checked in at 2017-08-18 15:05:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-WebTest (Old)
 and      /work/SRC/openSUSE:Factory/.python-WebTest.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-WebTest"

Fri Aug 18 15:05:00 2017 rev:22 rq:517300 version:2.0.28

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-WebTest/python-WebTest.changes    
2017-05-18 20:48:11.052411560 +0200
+++ /work/SRC/openSUSE:Factory/.python-WebTest.new/python-WebTest.changes       
2017-08-18 15:05:06.828156334 +0200
@@ -1,0 +2,13 @@
+Tue Aug 15 16:23:29 UTC 2017 - toddrme2...@gmail.com
+
+- Update to 2.0.28
+  * Fixed #185: Fix strict cookie policy
+  * Fixed #146: Improve fields value checking when enctype is
+    multipart
+  * Fixed #119: Assertion error should be raised when you have
+    non-string response header
+  * Bugfix: Allow to set an int value to form fields when enctype
+    is multipart
+  * Added py36 to tox.ini / .travis.yaml
+
+-------------------------------------------------------------------

Old:
----
  WebTest-2.0.27.tar.gz

New:
----
  WebTest-2.0.28.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-WebTest.spec ++++++
--- /var/tmp/diff_new_pack.naYjAy/_old  2017-08-18 15:05:07.876008752 +0200
+++ /var/tmp/diff_new_pack.naYjAy/_new  2017-08-18 15:05:07.884007626 +0200
@@ -16,12 +16,11 @@
 #
 
 
-%bcond_without tests
-
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define oldpython python
+%bcond_without tests
 Name:           python-WebTest
-Version:        2.0.27
+Version:        2.0.28
 Release:        0
 Url:            http://webtest.pythonpaste.org/
 Summary:        Helper to test WSGI applications
@@ -94,8 +93,9 @@
 
 %files %{python_files}
 %defattr(-,root,root,-)
-%doc README.rst docs/license.rst
-%{python_sitelib}/*
+%doc CHANGELOG.rst README.rst docs/license.rst
+%{python_sitelib}/webtest/
+%{python_sitelib}/WebTest-%{version}-py*.egg-info
 
 %files  -n %{name}-doc
 %defattr(-,root,root,-)

++++++ WebTest-2.0.27.tar.gz -> WebTest-2.0.28.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/CHANGELOG.rst 
new/WebTest-2.0.28/CHANGELOG.rst
--- old/WebTest-2.0.27/CHANGELOG.rst    2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/CHANGELOG.rst    2017-08-01 17:29:14.000000000 +0200
@@ -1,6 +1,21 @@
 News
 ====
 
+2.0.28 (2017-08-01)
+-------------------
+
+- Fixed #185: Fix strict cookie policy
+
+- Fixed #146: Improve fields value checking when enctype is multipart
+
+- Fixed #119: Assertion error should be raised when you have non-string
+  response header
+
+- Bugfix: Allow to set an int value to form fields when enctype is multipart
+
+- Added py36 to tox.ini / .travis.yaml
+
+
 2.0.27 (2017-03-15)
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/PKG-INFO new/WebTest-2.0.28/PKG-INFO
--- old/WebTest-2.0.27/PKG-INFO 2017-03-15 09:18:08.000000000 +0100
+++ new/WebTest-2.0.28/PKG-INFO 2017-08-01 17:29:15.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: WebTest
-Version: 2.0.27
+Version: 2.0.28
 Summary: Helper to test WSGI applications
 Home-page: http://webtest.pythonpaste.org/
 Author: Gael Pasgrimaud
@@ -32,3 +32,4 @@
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/RELEASING.rst 
new/WebTest-2.0.28/RELEASING.rst
--- old/WebTest-2.0.27/RELEASING.rst    1970-01-01 01:00:00.000000000 +0100
+++ new/WebTest-2.0.28/RELEASING.rst    2017-08-01 17:29:14.000000000 +0200
@@ -0,0 +1,70 @@
+Releasing WebTest
+=================
+
+- For clarity, we define releases as follows.
+
+  - Alpha, beta, dev and similar statuses do not qualify whether a release is
+    major or minor. The term "pre-release" means alpha, beta, or dev.
+
+  - A release is final when it is no longer pre-release.
+
+  - A *major* release is where the first number either before or after the
+    first dot increases. Examples: 1.6 to 1.7a1, or 1.8 to 2.0.
+
+  - A *minor* or *bug fix* release is where the number after the second dot
+    increases. Example: 1.6 to 1.6.1.
+
+
+Releasing with zest.releaser
+----------------------------
+
+- First install `zest.releaser <https://pypi.python.org/pypi/zest.releaser>`_::
+
+    $ pip install zest.releaser[recommanded]
+
+- Add this to your ``~/.pypirc``::
+
+    [zest.releaser]
+    no-input = true
+    create-wheel = yes
+
+- Edit ``CHANGELOG.rst``
+
+- Run the fullrelease script::
+
+    $ fullrelease
+
+Marketing and communications
+----------------------------
+
+- Announce to Twitter::
+
+    WebTest 1.x released.
+
+    PyPI
+    https://pypi.python.org/pypi/webtest/2.x
+
+    Changes
+    http://docs.pylonsproject.org/projects/webtest
+
+    Issues
+    https://github.com/Pylons/webtest/issues
+
+- Announce to maillist::
+
+    WebTest 2.X.X has been released.
+
+    Here are the changes:
+
+    <<changes>>
+
+    You can install it via PyPI:
+
+      pip install WebTest==2.X
+
+    Enjoy, and please report any issues you find to the issue tracker at
+    https://github.com/Pylons/webtest/issues
+
+    Thanks!
+
+    - WebTest developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/WebTest.egg-info/PKG-INFO 
new/WebTest-2.0.28/WebTest.egg-info/PKG-INFO
--- old/WebTest-2.0.27/WebTest.egg-info/PKG-INFO        2017-03-15 
09:18:08.000000000 +0100
+++ new/WebTest-2.0.28/WebTest.egg-info/PKG-INFO        2017-08-01 
17:29:15.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: WebTest
-Version: 2.0.27
+Version: 2.0.28
 Summary: Helper to test WSGI applications
 Home-page: http://webtest.pythonpaste.org/
 Author: Gael Pasgrimaud
@@ -32,3 +32,4 @@
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/WebTest.egg-info/SOURCES.txt 
new/WebTest-2.0.28/WebTest.egg-info/SOURCES.txt
--- old/WebTest-2.0.27/WebTest.egg-info/SOURCES.txt     2017-03-15 
09:18:08.000000000 +0100
+++ new/WebTest-2.0.28/WebTest.egg-info/SOURCES.txt     2017-08-01 
17:29:15.000000000 +0200
@@ -2,6 +2,7 @@
 CHANGELOG.rst
 MANIFEST.in
 README.rst
+RELEASING.rst
 setup.cfg
 setup.py
 tox.ini
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/docs/changelog.rst 
new/WebTest-2.0.28/docs/changelog.rst
--- old/WebTest-2.0.27/docs/changelog.rst       2017-03-15 09:18:07.000000000 
+0100
+++ new/WebTest-2.0.28/docs/changelog.rst       2017-08-01 17:29:14.000000000 
+0200
@@ -1,6 +1,21 @@
 News
 ====
 
+2.0.28 (2017-08-01)
+-------------------
+
+- Fixed #185: Fix strict cookie policy
+
+- Fixed #146: Improve fields value checking when enctype is multipart
+
+- Fixed #119: Assertion error should be raised when you have non-string
+  response header
+
+- Bugfix: Allow to set an int value to form fields when enctype is multipart
+
+- Added py36 to tox.ini / .travis.yaml
+
+
 2.0.27 (2017-03-15)
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/setup.py new/WebTest-2.0.28/setup.py
--- old/WebTest-2.0.27/setup.py 2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/setup.py 2017-08-01 17:29:14.000000000 +0200
@@ -5,7 +5,7 @@
 from setuptools import setup
 from setuptools import find_packages
 
-version = '2.0.27'
+version = '2.0.28'
 
 install_requires = [
     'six',
@@ -37,6 +37,7 @@
           "Programming Language :: Python :: 3.3",
           "Programming Language :: Python :: 3.4",
           "Programming Language :: Python :: 3.5",
+          "Programming Language :: Python :: 3.6",
       ],
       keywords='wsgi test unit tests web',
       author='Ian Bicking',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/tests/test_app.py 
new/WebTest-2.0.28/tests/test_app.py
--- old/WebTest-2.0.27/tests/test_app.py        2017-03-15 09:18:07.000000000 
+0100
+++ new/WebTest-2.0.28/tests/test_app.py        2017-08-01 17:29:14.000000000 
+0200
@@ -357,6 +357,39 @@
         self.assertEqual(res.request.environ['HTTP_COOKIE'], 'spam=eggs')
         self.assertEqual(dict(res.request.cookies), {'spam': 'eggs'})
 
+    def test_cookie_policy(self):
+        from six.moves import http_cookiejar
+
+        def cookie_app(environ, start_response):
+            status = to_bytes("200 OK")
+            body = 'Cookie.'
+            headers = [
+                ('Content-Type', 'text/plain'),
+                ('Content-Length', str(len(body))),
+                ('Set-Cookie',
+                 'spam=eggs; secure; Domain=.example.org;'),
+            ]
+            start_response(status, headers)
+            return [to_bytes(body)]
+
+        policy = webtest.app.CookiePolicy()
+        flags = (
+            policy.DomainStrictNoDots |
+            policy.DomainRFC2965Match |
+            policy.DomainStrictNonDomain)
+        policy.strict_ns_domain |= flags
+        cookiejar = http_cookiejar.CookieJar(policy=policy)
+        app = webtest.TestApp(
+            cookie_app,
+            cookiejar=cookiejar,
+            extra_environ={'HTTP_HOST': 'example.org'})
+        res = app.get('/')
+        res = app.get('/')
+        self.assertFalse(app.cookies,
+                        'Response should not have set cookies')
+        self.assertNotIn('HTTP_COOKIE', res.request.environ)
+        self.assertEqual(dict(res.request.cookies), {})
+
 
 class TestEnviron(unittest.TestCase):
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/tests/test_forms.py 
new/WebTest-2.0.28/tests/test_forms.py
--- old/WebTest-2.0.27/tests/test_forms.py      2017-03-15 09:18:07.000000000 
+0100
+++ new/WebTest-2.0.28/tests/test_forms.py      2017-08-01 17:29:14.000000000 
+0200
@@ -321,6 +321,8 @@
     headers = [
         ('Content-Type', 'text/html; charset=utf-8'),
         ('Content-Length', str(len(body)))]
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(status, headers)
     return [body]
 
@@ -373,6 +375,8 @@
     headers = [
         ('Content-Type', 'text/html; charset=utf-8'),
         ('Content-Length', str(len(body)))]
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(status, headers)
     return [body]
 
@@ -425,6 +429,8 @@
     headers = [
         ('Content-Type', 'text/html; charset=utf-8'),
         ('Content-Length', str(len(body)))]
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(status, headers)
     return [body]
 
@@ -476,6 +482,8 @@
     headers = [
         ('Content-Type', 'text/html; charset=utf-8'),
         ('Content-Length', str(len(body)))]
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(status, headers)
     if not isinstance(body, binary_type):
         raise AssertionError('Body is not %s' % binary_type)
@@ -736,6 +744,7 @@
         display = multiple_form.submit("button")
         self.assertIn("<p>You selected </p>", display, display)
 
+
 class SingleUploadFileApp(object):
 
     body = b"""
@@ -745,6 +754,7 @@
         <form method="POST" id="file_upload_form"
               enctype="multipart/form-data">
             <input name="file-field" type="file" value="some/path/file.txt" />
+            <input name="int-field" type="text" value="" />
             <input name="button" type="submit" value="single">
         </form>
     </body>
@@ -768,6 +778,8 @@
         headers = [
             ('Content-Type', 'text/html; charset=utf-8'),
             ('Content-Length', str(len(body)))]
+        # PEP 3333 requires native strings:
+        headers = [(str(k), str(v)) for k, v in headers]
         start_response(status, headers)
         assert(isinstance(body, binary_type))
         return [body]
@@ -940,6 +952,25 @@
         self.assertFile(uploaded_file1_name, uploaded_file1_contents, display)
         self.assertFile(uploaded_file1_name, uploaded_file1_contents, display)
 
+    def test_post_int(self):
+        binary_data = struct.pack(str('255h'), *range(0, 255))
+        app = webtest.TestApp(SingleUploadFileApp())
+        res = app.get('/')
+        single_form = res.forms["file_upload_form"]
+        single_form.set("file-field", ('my_file.dat', binary_data))
+        single_form.set("int-field", 100)
+        # just check it does not raise
+        single_form.submit("button")
+
+    def test_invalid_types(self):
+        binary_data = struct.pack(str('255h'), *range(0, 255))
+        app = webtest.TestApp(SingleUploadFileApp())
+        res = app.get('/')
+        single_form = res.forms["file_upload_form"]
+        single_form.set("file-field", ('my_file.dat', binary_data))
+        single_form.set("int-field", SingleUploadFileApp())
+        self.assertRaises(ValueError, single_form.submit, "button")
+
     def test_upload_invalid_content(self):
         app = webtest.TestApp(SingleUploadFileApp())
         res = app.get('/')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/tests/test_lint.py 
new/WebTest-2.0.28/tests/test_lint.py
--- old/WebTest-2.0.27/tests/test_lint.py       2017-03-15 09:18:07.000000000 
+0100
+++ new/WebTest-2.0.28/tests/test_lint.py       2017-08-01 17:29:14.000000000 
+0200
@@ -114,6 +114,8 @@
             headers = [
                 ('Content-Type', 'text/plain; charset=utf-8'),
                 ('Content-Length', str(len(body)))]
+            # PEP 3333 requires native strings:
+            headers = [(str(k), str(v)) for k, v in headers]
             start_response(to_bytes('200 OK'), headers, ('stuff',))
             return [body]
 
@@ -141,13 +143,33 @@
 
 class TestCheckHeaders(unittest.TestCase):
 
-    @unittest.skipIf(not PY3, 'Useless in Python2')
+    @unittest.skipIf(PY3, 'unicode is str in Python3')
+    def test_header_unicode_name(self):
+        headers = [(u'X-Price', str('100'))]
+        self.assertRaises(AssertionError, check_headers, headers)
+
+    @unittest.skipIf(PY3, 'unicode is str in Python3')
     def test_header_unicode_value(self):
-        self.assertRaises(AssertionError, check_headers, [('X-Price', '100€')])
+        headers = [(str('X-Price'), u'100')]
+        self.assertRaises(AssertionError, check_headers, headers)
 
-    @unittest.skipIf(not PY3, 'Useless in Python2')
-    def test_header_unicode_name(self):
-        self.assertRaises(AssertionError, check_headers, [('X-€', 'foo')])
+    @unittest.skipIf(not PY3, 'bytes is str in Python2')
+    def test_header_bytes_name(self):
+        headers = [(b'X-Price', '100')]
+        self.assertRaises(AssertionError, check_headers, headers)
+
+    @unittest.skipIf(not PY3, 'bytes is str in Python2')
+    def test_header_bytes_value(self):
+        headers = [('X-Price', b'100')]
+        self.assertRaises(AssertionError, check_headers, headers)
+
+    def test_header_non_latin1_value(self):
+        headers = [(str('X-Price'), '100€')]
+        self.assertRaises(AssertionError, check_headers, headers)
+
+    def test_header_non_latin1_name(self):
+        headers = [('X-€', str('foo'))]
+        self.assertRaises(AssertionError, check_headers, headers)
 
 
 class TestCheckEnviron(unittest.TestCase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/tests/test_response.py 
new/WebTest-2.0.28/tests/test_response.py
--- old/WebTest-2.0.27/tests/test_response.py   2017-03-15 09:18:07.000000000 
+0100
+++ new/WebTest-2.0.28/tests/test_response.py   2017-08-01 17:29:14.000000000 
+0200
@@ -115,7 +115,8 @@
     ]
     if req.path_info in utf8_paths:
         headers[0] = ('Content-Type', str('text/html; charset=utf-8'))
-
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(str(status), headers)
     return [body]
 
@@ -127,7 +128,8 @@
         ('Content-Type', str('text/html')),
         ('Content-Encoding', str('gzip')),
     ]
-
+    # PEP 3333 requires native strings:
+    headers = [(str(k), str(v)) for k, v in headers]
     start_response(str(status), headers)
     return encoded_body
 
@@ -423,6 +425,8 @@
                 remaining_redirects[0] -= 1
 
             headers.append(('Content-Length', str(len(body))))
+            # PEP 3333 requires native strings:
+            headers = [(str(k), str(v)) for k, v in headers]
             start_response(str(status), headers)
             return [body]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/tox.ini new/WebTest-2.0.28/tox.ini
--- old/WebTest-2.0.27/tox.ini  2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/tox.ini  2017-08-01 17:29:14.000000000 +0200
@@ -1,6 +1,6 @@
 [tox]
 skip_missing_interpreters=true
-envlist=py27,py33,py34,py35,coverage
+envlist=py27,py33,py34,py35,py36,coverage
 
 [testenv]
 setenv =
@@ -19,9 +19,9 @@
 commands =
   {envbindir}/python --version
   {envbindir}/pip freeze
-  py{26,27,33}: {envbindir}/nosetests  --with-coverage --with-xunit 
--xunit-file=nosetests-{envname}.xml []
+  py{27,33}: {envbindir}/nosetests  --with-coverage --with-xunit 
--xunit-file=nosetests-{envname}.xml []
   py{27,33}: {envbindir}/coverage xml -o coverage-{envname}.xml
-  py{34,35}: {envbindir}/nosetests
+  py{34,35,36}: {envbindir}/nosetests
 
 [testenv:coverage]
 deps =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/webtest/app.py 
new/WebTest-2.0.28/webtest/app.py
--- old/WebTest-2.0.27/webtest/app.py   2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/webtest/app.py   2017-08-01 17:29:14.000000000 +0200
@@ -69,13 +69,13 @@
     Domain=localhost."""
 
     def return_ok_domain(self, cookie, request):
-        if cookie.domain.endswith(request.origin_req_host):
+        if cookie.domain == '.localhost':
             return True
         return http_cookiejar.DefaultCookiePolicy.return_ok_domain(
             self, cookie, request)
 
     def set_ok_domain(self, cookie, request):
-        if cookie.domain.endswith(request.origin_req_host):
+        if cookie.domain == '.localhost':
             return True
         return http_cookiejar.DefaultCookiePolicy.set_ok_domain(
             self, cookie, request)
@@ -231,9 +231,10 @@
         Sets a cookie to be passed through with requests.
 
         """
-        cookie_domain = self.extra_environ.get('HTTP_HOST', 'localhost')
+        cookie_domain = self.extra_environ.get('HTTP_HOST', '.localhost')
         cookie_domain = cookie_domain.split(':', 1)[0]
-        cookie_domain = '.' + cookie_domain
+        if '.' not in cookie_domain:
+            cookie_domain = "%s.local" % cookie_domain
         value = escape_cookie_value(value)
         cookie = http_cookiejar.Cookie(
             version=0,
@@ -518,8 +519,15 @@
                         file_info.append(value.content_type)
                 _append_file(file_info)
             else:
-                if isinstance(value, text_type):
+                if isinstance(value, int):
+                    value = str(value).encode('utf8')
+                elif isinstance(value, text_type):
                     value = value.encode('utf8')
+                elif not isinstance(value, (bytes, str)):
+                    raise ValueError((
+                        'Value for field {0} is a {1} ({2}). '
+                        'It must be str, bytes or an int'
+                    ).format(key, type(value), value))
                 lines.extend([
                     b'--' + boundary,
                     b'Content-Disposition: form-data; name="' + key + b'"',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/webtest/lint.py 
new/WebTest-2.0.28/webtest/lint.py
--- old/WebTest-2.0.27/webtest/lint.py  2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/webtest/lint.py  2017-08-01 17:29:14.000000000 +0200
@@ -59,7 +59,8 @@
 * That the headers is a list (not a subclass, not another kind of
   sequence).
 
-* That the items of the headers are tuples of strings.
+* That the items of the headers are tuples of 'native' strings (i.e.
+  bytestrings in Python2, and unicode strings in Python3).
 
 * That there is no 'status' header (that is used in CGI, but not in
   WSGI).
@@ -412,12 +413,12 @@
         "digits and a space (4th characters is not a space here)") % status
 
 
-def _assert_latin1_py3(string, message):
-    if PY3 and type(string) is str:
-        try:
-            string.encode('latin1')
-        except UnicodeEncodeError:
-            raise AssertionError(message)
+def _assert_latin1_str(string, message):
+    assert type(string) is str, message
+    try:
+        string.encode('latin1')
+    except UnicodeEncodeError:
+        raise AssertionError(message)
 
 
 def check_headers(headers):
@@ -430,30 +431,30 @@
             % (item, type(item)))
         assert len(item) == 2
         name, value = item
-        _assert_latin1_py3(
+        _assert_latin1_str(
             name,
-            "Headers values must be latin1 string or bytes."
-            "%r is not a valid latin1 string" % (value,)
+            "Header names must be latin1 string "
+            "(not Py2 unicode or Py3 bytes type). "
+            "%r is not a valid latin1 string" % (name,)
         )
-        str_name = to_string(name)
-        assert str_name.lower() != 'status', (
+        assert name.lower() != 'status', (
             "The Status header cannot be used; it conflicts with CGI "
             "script, and HTTP status is not given through headers "
             "(value: %r)." % value)
-        assert '\n' not in str_name and ':' not in str_name, (
+        assert '\n' not in name and ':' not in name, (
             "Header names may not contain ':' or '\\n': %r" % name)
-        assert header_re.search(str_name), "Bad header name: %r" % name
-        assert not str_name.endswith('-') and not str_name.endswith('_'), (
+        assert header_re.search(name), "Bad header name: %r" % name
+        assert not name.endswith('-') and not name.endswith('_'), (
             "Names may not end in '-' or '_': %r" % name)
-        _assert_latin1_py3(
+        _assert_latin1_str(
             value,
-            "Headers values must be latin1 string or bytes."
+            "Header values must be latin1 string "
+            "(not Py2 unicode or Py3 bytes type)."
             "%r is not a valid latin1 string" % (value,)
         )
-        str_value = to_string(value)
-        assert not bad_header_value_re.search(str_value), (
+        assert not bad_header_value_re.search(value), (
             "Bad header value: %r (bad char: %r)"
-            % (str_value, bad_header_value_re.search(str_value).group(0)))
+            % (str_value, bad_header_value_re.search(value).group(0)))
 
 
 def check_content_type(status, headers):
@@ -464,13 +465,11 @@
     NO_MESSAGE_TYPE = (204, 304)
     length = None
     for name, value in headers:
-        str_name = to_string(name)
-        if str_name.lower() == 'content-length' and value.isdigit():
+        if name.lower() == 'content-length' and value.isdigit():
             length = int(value)
             break
     for name, value in headers:
-        str_name = to_string(name)
-        if str_name.lower() == 'content-type':
+        if name.lower() == 'content-type':
             if code not in NO_MESSAGE_TYPE:
                 return
             elif length == 0:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/WebTest-2.0.27/webtest/utils.py 
new/WebTest-2.0.28/webtest/utils.py
--- old/WebTest-2.0.27/webtest/utils.py 2017-03-15 09:18:07.000000000 +0100
+++ new/WebTest-2.0.28/webtest/utils.py 2017-08-01 17:29:14.000000000 +0200
@@ -97,7 +97,7 @@
     """
     def __init__(self, request):
         self._request = request
-        self.origin_req_host = request.host.split(':')[0]
+        self.origin_req_host = request.host
 
     def is_unverifiable(self):
         return True  # sure? Why not?


Reply via email to