Hello community,
here is the log from the commit of package python-zope.testbrowser for
openSUSE:Factory checked in at 2019-07-22 17:19:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zope.testbrowser (Old)
and /work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zope.testbrowser"
Mon Jul 22 17:19:00 2019 rev:10 rq:717543 version:5.3.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-zope.testbrowser/python-zope.testbrowser.changes
2019-04-23 14:35:22.229443821 +0200
+++
/work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.4126/python-zope.testbrowser.changes
2019-07-22 17:19:02.189927604 +0200
@@ -1,0 +2,7 @@
+Mon Jul 22 10:57:47 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 5.3.3:
+ * Fix a bug where clicking the selected radio button would unselect it. See
issue 68.
+ * Fix another incompatibility with BeautifulSoup4 >= 4.7 that could result
in a SyntaxError from browser.getLink(). See issue 61.
+
+-------------------------------------------------------------------
Old:
----
zope.testbrowser-5.3.2.tar.gz
New:
----
zope.testbrowser-5.3.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-zope.testbrowser.spec ++++++
--- /var/tmp/diff_new_pack.vmKcWd/_old 2019-07-22 17:19:02.937927008 +0200
+++ /var/tmp/diff_new_pack.vmKcWd/_new 2019-07-22 17:19:02.937927008 +0200
@@ -18,41 +18,44 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-zope.testbrowser
-Version: 5.3.2
+Version: 5.3.3
Release: 0
Summary: Programmable browser for functional black-box tests
License: ZPL-2.1
Group: Development/Languages/Python
-Url: https://github.com/zopefoundation/zope.testbrowser
+URL: https://github.com/zopefoundation/zope.testbrowser
Source:
https://files.pythonhosted.org/packages/source/z/zope.testbrowser/zope.testbrowser-%{version}.tar.gz
Patch0: zope.testbrowser-remove-bad-test.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+Requires: python-WSGIProxy2
+Requires: python-WebTest >= 2.0.30
+Requires: python-beautifulsoup4
+Requires: python-pytz > dev
+Requires: python-setuptools
+Requires: python-six
+Requires: python-soupsieve >= 1.9.0
+Requires: python-zope.cachedescriptors
+Requires: python-zope.interface
+Requires: python-zope.schema
+Suggests: python-mock
+Suggests: python-zope.testing
+BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module WSGIProxy2}
BuildRequires: %{python_module WebTest >= 2.0.30}
+BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytz > dev}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
+BuildRequires: %{python_module soupsieve >= 1.9.0}
BuildRequires: %{python_module zope.cachedescriptors}
BuildRequires: %{python_module zope.interface}
BuildRequires: %{python_module zope.schema}
BuildRequires: %{python_module zope.testing}
# /SECTION
-Requires: python-WSGIProxy2
-Requires: python-WebTest >= 2.0.30
-Requires: python-pytz > dev
-Requires: python-setuptools
-Requires: python-six
-Requires: python-zope.cachedescriptors
-Requires: python-zope.interface
-Requires: python-zope.schema
-Suggests: python-zope.testing
-Suggests: python-mock
-BuildArch: noarch
-
%python_subpackages
%description
++++++ zope.testbrowser-5.3.2.tar.gz -> zope.testbrowser-5.3.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.2/CHANGES.rst
new/zope.testbrowser-5.3.3/CHANGES.rst
--- old/zope.testbrowser-5.3.2/CHANGES.rst 2019-02-06 14:55:31.000000000
+0100
+++ new/zope.testbrowser-5.3.3/CHANGES.rst 2019-07-02 13:25:02.000000000
+0200
@@ -2,6 +2,17 @@
CHANGES
=======
+5.3.3 (2019-07-02)
+------------------
+
+- Fix a bug where clicking the selected radio button would unselect it. See
+ `issue 68 <https://github.com/zopefoundation/zope.testbrowser/issues/68>`_.
+
+- Fix another incompatibility with BeautifulSoup4 >= 4.7 that could result
+ in a SyntaxError from browser.getLink(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+
5.3.2 (2019-02-06)
------------------
@@ -158,12 +169,12 @@
zope.app.wsgi.testlayer.BrowserLayer):
"""Layer to prepare zope.testbrowser using the WSGI app."""
- layer = Layer(my.package)
+ layer = Layer(my.package, 'ftesting.zcml', allowTearDown=True)
def test_suite():
suite = doctest.DocFileSuite('test.txt', ...)
suite.layer = layer
- return TestSuite((suite,))
+ return suite
and then change all your tests from ::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.2/PKG-INFO
new/zope.testbrowser-5.3.3/PKG-INFO
--- old/zope.testbrowser-5.3.2/PKG-INFO 2019-02-06 14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/PKG-INFO 2019-07-02 13:25:02.000000000 +0200
@@ -1,11 +1,12 @@
Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.3.2
+Version: 5.3.3
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
Author-email: [email protected]
License: ZPL 2.1
+Project-URL: Documentation, https://zopetestbrowser.readthedocs.io/
Description: ``zope.testbrowser`` README
===========================
@@ -32,6 +33,17 @@
CHANGES
=======
+ 5.3.3 (2019-07-02)
+ ------------------
+
+ - Fix a bug where clicking the selected radio button would unselect
it. See
+ `issue 68
<https://github.com/zopefoundation/zope.testbrowser/issues/68>`_.
+
+ - Fix another incompatibility with BeautifulSoup4 >= 4.7 that could
result
+ in a SyntaxError from browser.getLink(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+
5.3.2 (2019-02-06)
------------------
@@ -188,12 +200,12 @@
zope.app.wsgi.testlayer.BrowserLayer):
"""Layer to prepare zope.testbrowser using the WSGI app."""
- layer = Layer(my.package)
+ layer = Layer(my.package, 'ftesting.zcml', allowTearDown=True)
def test_suite():
suite = doctest.DocFileSuite('test.txt', ...)
suite.layer = layer
- return TestSuite((suite,))
+ return suite
and then change all your tests from ::
@@ -526,6 +538,6 @@
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
+Provides-Extra: test
Provides-Extra: test_bbb
Provides-Extra: wsgi
-Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.2/setup.py
new/zope.testbrowser-5.3.3/setup.py
--- old/zope.testbrowser-5.3.2/setup.py 2019-02-06 14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/setup.py 2019-07-02 13:25:02.000000000 +0200
@@ -27,9 +27,12 @@
setup(
name='zope.testbrowser',
- version='5.3.2',
+ version='5.3.3',
url='https://github.com/zopefoundation/zope.testbrowser',
license='ZPL 2.1',
+ project_urls={
+ 'Documentation': 'https://zopetestbrowser.readthedocs.io/',
+ },
description='Programmable browser for functional black-box tests',
author='Zope Corporation and Contributors',
author_email='[email protected]',
@@ -62,6 +65,8 @@
'zope.cachedescriptors',
'pytz > dev',
'WebTest >= 2.0.30',
+ 'BeautifulSoup4',
+ 'SoupSieve >= 1.9.0',
'WSGIProxy2',
'six',
],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py
new/zope.testbrowser-5.3.3/src/zope/testbrowser/browser.py
--- old/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py 2019-02-06
14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/src/zope/testbrowser/browser.py 2019-07-02
13:25:02.000000000 +0200
@@ -27,6 +27,7 @@
from zope.cachedescriptors.property import Lazy
from wsgiproxy.proxies import TransparentProxy
from bs4 import BeautifulSoup
+from soupsieve import escape as css_escape
from zope.testbrowser import interfaces
from zope.testbrowser._compat import httpclient, PYTHON2
@@ -313,8 +314,8 @@
def getLink(self, text=None, url=None, id=None, index=0):
"""See zope.testbrowser.interfaces.IBrowser"""
- qa = 'a' if id is None else 'a#%s' % id
- qarea = 'area' if id is None else 'area#%s' % id
+ qa = 'a' if id is None else 'a#%s' % css_escape(id)
+ qarea = 'area' if id is None else 'area#%s' % css_escape(id)
html = self._html
links = html.select(qa)
links.extend(html.select(qarea))
@@ -1151,6 +1152,12 @@
"<ItemControl name='%s' type='radio' optionValue=%r selected=%r>"
) % (self._parent.name, self.optionValue, self.selected)
+ def click(self):
+ # Radio buttons cannot be unselected by clicking on them, see
+ # https://github.com/zopefoundation/zope.testbrowser/issues/68
+ if not self.selected:
+ super(RadioItemControl, self).click()
+
def mechRepr(self):
toStr = self.browser.toStr
id = toStr(self._elem.attrs.get('id'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_browser.py
new/zope.testbrowser-5.3.3/src/zope/testbrowser/tests/test_browser.py
--- old/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_browser.py
2019-02-06 14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/src/zope/testbrowser/tests/test_browser.py
2019-07-02 13:25:02.000000000 +0200
@@ -30,6 +30,8 @@
next_response_status = '200'
next_response_reason = 'OK'
+ verbose = True
+
def set_next_response(self, body, headers=None, status='200', reason='OK'):
if headers is None:
headers = [('Content-Type', 'text/html; charset="UTF-8"'),
@@ -39,25 +41,33 @@
self.next_response_status = status
self.next_response_reason = reason
+ def print(self, *args, **kw):
+ if self.verbose:
+ print(*args, **kw)
+
def __call__(self, environ, start_response):
qs = environ.get('QUERY_STRING')
- print("%s %s%s HTTP/1.1" % (environ['REQUEST_METHOD'],
- environ['PATH_INFO'],
- '?'+qs if qs else ""
- ))
+ self.print("%s %s%s HTTP/1.1" % (environ['REQUEST_METHOD'],
+ environ['PATH_INFO'],
+ ('?' + qs) if qs else ""
+ ))
# print all the headers
for ek, ev in sorted(environ.items()):
if ek.startswith('HTTP_'):
- print("%s: %s" % (ek[5:].title(), ev))
- print()
+ self.print("%s: %s" % (ek[5:].title(), ev))
+ self.print()
inp = environ['wsgi.input'].input.getvalue()
- print(inp.decode('utf8'))
+ self.print(inp.decode('utf8'))
status = '%s %s' % (self.next_response_status,
self.next_response_reason)
start_response(status, self.next_response_headers)
return [self.next_response_body]
+class QuietTestApp(TestApp):
+ verbose = False
+
+
class YetAnotherTestApp(object):
def __init__(self):
@@ -89,7 +99,7 @@
def setUp(self):
super(TestDisplayValue, self).setUp()
- app = TestApp()
+ app = QuietTestApp()
app.set_next_response(b'''\
<html>
<body>
@@ -127,7 +137,7 @@
def setUp(self):
super(TestMechRepr, self).setUp()
- app = TestApp()
+ app = QuietTestApp()
app.set_next_response(u'''\
<html>
<body>
@@ -1004,6 +1014,37 @@
"""
+def test_radio_buttons_cannot_be_unselected():
+ """
+ >>> app = TestApp()
+ >>> browser = Browser(wsgi_app=app)
+ >>> app.set_next_response(b'''
+ ... <html><body>
+ ... <form method='get' action='action'>
+ ... <input type="radio" name="foo" id="foo1" value="v1" checked>
+ ... <label for="foo1">label 1</label>
+ ... <input type="radio" name="foo" id="foo2" value="v2">
+ ... <label for="foo2">label 2</label>
+ ... </form>
+ ... </body></html>
+ ... ''')
+ >>> browser.open('http://localhost/foo') # doctest: +ELLIPSIS
+ GET /foo HTTP/1.1
+ ...
+ >>> browser.getControl(name='foo').value
+ ['v1']
+
+ >>> browser.getControl('label 1').click()
+ >>> browser.getControl(name='foo').value
+ ['v1']
+
+ >>> browser.getControl('label 2').click()
+ >>> browser.getControl(name='foo').value
+ ['v2']
+
+ """
+
+
UNICODE_TEST = u'\u4e2d\u6587\u7dad' # unicode in doctests is hard!
@@ -1096,6 +1137,23 @@
'http://localhost/foo'
"""
+
+def test_links_with_complicated_id(self):
+ """
+ >>> app = TestApp()
+ >>> browser = Browser(wsgi_app=app)
+ >>> app.set_next_response(b'''\
+ ... <html><body>
+ ... <a href="/foo" id="form.foo">Foo</a>
+ ... </body></html>
+ ... ''')
+ >>> browser.open('http://localhost/')
+ GET / HTTP/1.1
+ ...
+ >>> browser.getLink(id='form.foo').url
+ 'http://localhost/foo'
+ """
+
def test_controls_without_value(self):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/PKG-INFO
new/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/PKG-INFO
--- old/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/PKG-INFO
2019-02-06 14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/PKG-INFO
2019-07-02 13:25:02.000000000 +0200
@@ -1,11 +1,12 @@
Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.3.2
+Version: 5.3.3
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
Author-email: [email protected]
License: ZPL 2.1
+Project-URL: Documentation, https://zopetestbrowser.readthedocs.io/
Description: ``zope.testbrowser`` README
===========================
@@ -32,6 +33,17 @@
CHANGES
=======
+ 5.3.3 (2019-07-02)
+ ------------------
+
+ - Fix a bug where clicking the selected radio button would unselect
it. See
+ `issue 68
<https://github.com/zopefoundation/zope.testbrowser/issues/68>`_.
+
+ - Fix another incompatibility with BeautifulSoup4 >= 4.7 that could
result
+ in a SyntaxError from browser.getLink(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+
5.3.2 (2019-02-06)
------------------
@@ -188,12 +200,12 @@
zope.app.wsgi.testlayer.BrowserLayer):
"""Layer to prepare zope.testbrowser using the WSGI app."""
- layer = Layer(my.package)
+ layer = Layer(my.package, 'ftesting.zcml', allowTearDown=True)
def test_suite():
suite = doctest.DocFileSuite('test.txt', ...)
suite.layer = layer
- return TestSuite((suite,))
+ return suite
and then change all your tests from ::
@@ -526,6 +538,6 @@
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
+Provides-Extra: test
Provides-Extra: test_bbb
Provides-Extra: wsgi
-Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/requires.txt
new/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/requires.txt
--- old/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/requires.txt
2019-02-06 14:55:31.000000000 +0100
+++ new/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/requires.txt
2019-07-02 13:25:02.000000000 +0200
@@ -1,15 +1,17 @@
+BeautifulSoup4
+SoupSieve>=1.9.0
+WSGIProxy2
+WebTest>=2.0.30
+pytz>dev
setuptools
+six
+zope.cachedescriptors
zope.interface
zope.schema
-zope.cachedescriptors
-pytz>dev
-WebTest>=2.0.30
-WSGIProxy2
-six
[test]
-zope.testing
mock
+zope.testing
[test_bbb]
zope.testbrowser[test]