Hello community, here is the log from the commit of package python-WebTest for openSUSE:Factory checked in at 2017-05-18 20:48:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-WebTest (Old) and /work/SRC/openSUSE:Factory/.python-WebTest.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-WebTest" Thu May 18 20:48:10 2017 rev:21 rq:494917 version:2.0.27 Changes: -------- --- /work/SRC/openSUSE:Factory/python-WebTest/python-WebTest.changes 2016-09-28 11:30:00.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-WebTest.new/python-WebTest.changes 2017-05-18 20:48:11.052411560 +0200 @@ -1,0 +2,20 @@ +Wed May 3 16:31:46 UTC 2017 - [email protected] + +- Update to 2.0.27 + * Bugfix: Allow to use set_cookie when HTTP_HOST is set + * Fix #177: resp.json now always decode body as utf8 +- Update to 2.0.26 + * Added JWT auth support + * Always show response body when response status is invalid +- Update to 2.0.25 + * Fix #173: Do not omit file uploads without a file from post. +- Update to 2.0.24 + * Drop python 2.6 support. Newer versions may still work if you + use waitress < 1.0 + * Remove bs4 warnings + * Docs improvments + * Tets are WebOb 1.7.x compatible +- Implement singlespec version +- Fix source URL. + +------------------------------------------------------------------- Old: ---- WebTest-2.0.23.tar.gz New: ---- WebTest-2.0.27.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-WebTest.spec ++++++ --- /var/tmp/diff_new_pack.jPMgbG/_old 2017-05-18 20:48:11.676323510 +0200 +++ /var/tmp/diff_new_pack.jPMgbG/_new 2017-05-18 20:48:11.680322946 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-WebTest # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,46 +16,48 @@ # +%bcond_without tests + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define oldpython python Name: python-WebTest -Version: 2.0.23 +Version: 2.0.27 Release: 0 Url: http://webtest.pythonpaste.org/ Summary: Helper to test WSGI applications License: MIT Group: Development/Languages/Python -Source: https://pypi.io/packages/source/W/WebTest/WebTest-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/W/WebTest/WebTest-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-PasteDeploy -BuildRequires: python-WSGIProxy2 -BuildRequires: python-base -BuildRequires: python-beautifulsoup4 -BuildRequires: python-cssselect -BuildRequires: python-mock -BuildRequires: python-pyquery -BuildRequires: python-setuptools -BuildRequires: python-six -BuildRequires: python-unittest2 -BuildRequires: python-waitress -# Documentation build requirements: -BuildRequires: python-Sphinx -# Test build requirements: -BuildRequires: python-WebOb -BuildRequires: python-coverage -BuildRequires: python-nose -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module PasteDeploy} +BuildRequires: %{python_module WebOb >= 1.2} +BuildRequires: %{python_module WSGIProxy2} +BuildRequires: %{python_module beautifulsoup4} +BuildRequires: %{python_module cssselect} +BuildRequires: %{python_module pyquery} +BuildRequires: %{python_module waitress >= 0.8.5} +%if %{with tests} +BuildRequires: %{python_module coverage} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module nose} BuildRequires: python-unittest2 %endif +# Documentation build requirements: +BuildRequires: python3-Sphinx Requires: python-WebOb >= 1.2 Requires: python-beautifulsoup4 Requires: python-six Requires: python-waitress >= 0.8.5 -Provides: python-webtest = %{version} -Obsoletes: python-webtest < %{version} -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch +%ifpython2 +Obsoletes: %{oldpython}-webtest < %{version} +Provides: %{oldpython}-webtest = %{version} %endif +BuildArch: noarch +%python_subpackages %description This wraps any WSGI application and makes it easy to send test @@ -64,12 +66,12 @@ This provides convenient full-stack testing of applications written with any WSGI-compatible framework. -%package doc +%package -n %{name}-doc Summary: Helper to test WSGI applications - Documentation Group: Documentation/HTML -Requires: %{name} = %{version} +Provides: %{python_module WebTest-doc = %{version}} -%description doc +%description -n %{name}-doc This package contains documentation files for %{name}. %prep @@ -78,23 +80,24 @@ sed -i 's/nose<1\.3\.0/nose/' setup.py %build -python setup.py build -python setup.py build_sphinx && rm build/sphinx/html/.buildinfo +%python_build +python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -%if 0%{?suse_version} > 1110 +%if %{with tests} %check -python setup.py -q test +%python_exec setup.py -q test %endif -%files +%files %{python_files} %defattr(-,root,root,-) %doc README.rst docs/license.rst %{python_sitelib}/* -%files doc +%files -n %{name}-doc %defattr(-,root,root,-) %doc build/sphinx/html ++++++ WebTest-2.0.23.tar.gz -> WebTest-2.0.27.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/CHANGELOG.rst new/WebTest-2.0.27/CHANGELOG.rst --- old/WebTest-2.0.23/CHANGELOG.rst 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/CHANGELOG.rst 2017-03-15 09:18:07.000000000 +0100 @@ -1,6 +1,41 @@ News ==== +2.0.27 (2017-03-15) +------------------- + +- Bugfix: Allow to use set_cookie when HTTP_HOST is set + +- Fix #177: resp.json now always decode body as utf8 + + +2.0.26 (2017-03-05) +------------------- + +- Added JWT auth support + +- Always show response body when response status is invalid + + +2.0.25 (2017-02-05) +------------------- + +- Fix #173: Do not omit file uploads without a file from post. + [Michael Howitz] + + +2.0.24 (2016-12-16) +------------------- + +- Drop python 2.6 support. Newer versions may still work if you use waitress < 1.0 + +- Remove bs4 warnings + +- Docs improvments + +- Tets are WebOb 1.7.x compatible + + 2.0.23 (2016-07-21) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/PKG-INFO new/WebTest-2.0.27/PKG-INFO --- old/WebTest-2.0.23/PKG-INFO 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/PKG-INFO 2017-03-15 09:18:08.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: WebTest -Version: 2.0.23 +Version: 2.0.27 Summary: Helper to test WSGI applications Home-page: http://webtest.pythonpaste.org/ Author: Gael Pasgrimaud @@ -27,7 +27,6 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/WebTest.egg-info/PKG-INFO new/WebTest-2.0.27/WebTest.egg-info/PKG-INFO --- old/WebTest-2.0.23/WebTest.egg-info/PKG-INFO 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/WebTest.egg-info/PKG-INFO 2017-03-15 09:18:08.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: WebTest -Version: 2.0.23 +Version: 2.0.27 Summary: Helper to test WSGI applications Home-page: http://webtest.pythonpaste.org/ Author: Gael Pasgrimaud @@ -27,7 +27,6 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/WebTest.egg-info/requires.txt new/WebTest-2.0.27/WebTest.egg-info/requires.txt --- old/WebTest-2.0.23/WebTest.egg-info/requires.txt 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/WebTest.egg-info/requires.txt 2017-03-15 09:18:08.000000000 +0100 @@ -3,9 +3,6 @@ waitress>=0.8.5 beautifulsoup4 -[:python_version=="2.6"] -ordereddict - [tests] nose<1.3.0 coverage @@ -13,7 +10,3 @@ PasteDeploy WSGIProxy2 pyquery -unittest2py3k - -[tests:python_version=="2.6"] -unittest2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/changelog.rst new/WebTest-2.0.27/docs/changelog.rst --- old/WebTest-2.0.23/docs/changelog.rst 2017-05-18 20:48:11.760311657 +0200 +++ new/WebTest-2.0.27/docs/changelog.rst 2017-03-15 09:18:07.000000000 +0100 @@ -1 +1,582 @@ -symbolic link to ../CHANGELOG.rst +News +==== + +2.0.27 (2017-03-15) +------------------- + +- Bugfix: Allow to use set_cookie when HTTP_HOST is set + +- Fix #177: resp.json now always decode body as utf8 + + +2.0.26 (2017-03-05) +------------------- + +- Added JWT auth support + +- Always show response body when response status is invalid + + +2.0.25 (2017-02-05) +------------------- + +- Fix #173: Do not omit file uploads without a file from post. + [Michael Howitz] + + +2.0.24 (2016-12-16) +------------------- + +- Drop python 2.6 support. Newer versions may still work if you use waitress < 1.0 + +- Remove bs4 warnings + +- Docs improvments + +- Tets are WebOb 1.7.x compatible + + +2.0.23 (2016-07-21) +------------------- + +- Create universal wheels. + + +2.0.22 (2016-07-21) +------------------- + +- Fix #160: Do not guess encoding if response's charset is set. + +2.0.21 (2016-04-12) +------------------- + +- PR #154 Allow Bearer auth + +- PR #147,#148 Take care of REFERER when using form.submit(), .click() and + .clickbutton() + +- PR #145 Allow to override content-type when using json methods + +2.0.20 (2015-11-03) +------------------- + +- nothing new release. just try to make wheel available on pypi + + +2.0.19 (2015-11-01) +------------------- + +- fixed #131 prevent passing HTML parameters that conflict with Field kwargs + +- fixed #135 Document that WSGIProxy2 is required for "using webtest with a real url" + +- fixed #136 reset values of select multiple + +- drop py32 support (still work but test dependencies fail) + +2.0.18 (2015-02-05) +------------------- + +- Avoid deprecation warning with py3.4 + + +2.0.17 (2014-12-20) +------------------- + +- Properly check for default cookiejar arguments + [Julian Berman] + +- Avoid raising encoding errors from debugapp (needed to use with WSGIProxy2) + [Laurence Rowe] + + +2.0.16 (2014-09-19) +------------------- + +- Fixed #110. Forced values for Radio inputs are no longer ignored by value + property on get. + [bayprogrammer] + +- Added method TestApp.set_parser_features to change the parser_features used + by BeautifulSoup. + [tomasmoreyra] + +- Added app.set_cookie + [luhn] + + +2.0.15 (2014-04-17) +------------------- + +- Fixed #73. Python < 2.6.5 does not support unicode as keyword arguments names. + [Stepan Kolesnik] + +- Fixed #84 Application cookies for localhost are no longer ignored + [gawel] + +- Fixed #89 remove WSGIWarning: You are not supposed to send a body in a DELETE + request because we now have a good reason for that. See http://bit.ly/1tb3yxW + [gawel] + +- Fixed #92 You can now override TestApp.JSONEncoder to use a custom encoder + [gawel] + +- Fixed #93 Support basic authentication + [gawel] + +- Fixed #103 Broken "Edit me on GitHub" links in documentation + [gawel] + +- Fixed #106 Make wrapping the app in the lint middleware optional + [dmlayton] + +- Fixed #107 Explicit error message when WSGIProxy2 is not installer + [gawel] + +- Fixed #108 cgi.parse_qsl is pending deprecation + [gawel] + +2.0.14 (2014-01-23) +------------------- + +- Allow `.select()` on <select>s and <select multiple>s. + [Markus Bertheau] + + +2.0.13 (2014-01-23) +------------------- + +- Allow selecting <select> options by text + [Markus Bertheau] + + +2.0.12 (2014-01-17) +------------------- + +- Ignore the `value` attribute of file inputs + [Markus Bertheau] + +- Allow selecting the form submit button by its value + [Markus Bertheau] + + +2.0.11 (2013-12-29) +------------------- + +- Depend on `unittest2` only for Python versions lower than 2.7 + [iElectric] + +- Add an optional parameter to `TestApp`, allowing the user to specify the + parser used by BeautifulSoup + [lyndsysimon] + + +2.0.10 (2013-11-14) +------------------- + +- Make StopableWSGIServer thread daemonic + [lrowe] + + +2.0.9 (2013-09-18) +------------------ + +- Make sure Upload.content_type is not ignored + https://github.com/Pylons/webtest/pull/88 + [Marius Gedminas] + + +2.0.8 (2013-09-17) +------------------ + +- Allow checking/unchecking a set of same-named checkboxes by assigning a list of values. + [carljm] + +- fix "AttributeError: 'InputWrapper' object has no attribute 'seek'" + [iElectric] + +- Added `xhr=True` parameter to `TestApp.get`, `TestApp.post`, `TestApp.head`, `TestApp.delete` + [kharandziuk] + +- Remove old (and broken?) casperjs/selenium backward compat imports. Fix + https://github.com/gawel/webtest-selenium/issues/9 + [gawel] + +- Allow optionally specifying the MIME type of an uploaded form file. Fixes #86 + [Marius Gedminas] + + +2.0.7 (2013-08-07) +------------------ + +- Detect JSON if mimetype ends with +json, such as application/vnd.webtest+json + [homm] + +- Fixed #72. Use WSGIServer new api even if there waitress has backward compat. + [gawel] + +- Fixed #50. Corrected default value for the delete params argument. + [noonat] + +- Be sure to decode the content if it is gziped before returning it + [Alexis Métaireau] + + +2.0.6 (2013-05-23) +------------------ + +- fixed #64. cookiejar api has changed in python3.3 [gawel] + +- allow to use a fixed StopableWSGIServer [gawel] + +- Do not alter the BeautifulSoup object when parsing forms. [Georges + Dubus] + +- Remove first newline while parse textarea block, how modern browsers does. + [Victor Safronovich] pull #69 + + +2.0.5 (2013-04-12) +------------------ + +* Ignore select.error (not socket.error) following + StopableWSGIServer.shutdown. [Laurence Rowe] + +* Handle the short form of <select multiple> [Marius Gedminas] + + +2.0.4 (2013-03-28) +------------------ + +* Correctly handle <option> elements with no value attribute + [Marius Gedminas] + +* Ignore socket.error following StopableWSGIServer.shutdown. [Laurence Rowe] + +* <button> without type='submit' attribute is treated as Submit + control [Andrey Lebedev]. + +* Support for redirects having relative "Location" header [Andrey Lebedev] + + +2.0.3 (2013-03-19) +------------------ + +* Treat strings in the WSGI environment as native strings, compliant with + PEP-3333. [wosc] + + +2.0.2 (2013-03-15) +------------------ + +* Allow TestResponse.click() to match HTML content again. [ender672] + +* Support secure cookies [Andrey Lebedev] + +2.0.1 (2013-03-05) +------------------ + +* Added Pasword field [diarmuidbourke] + +* re-allow to use unknow field type. Like ``type="email"``. [gawel] + +* Don't let BeautifulSoup use lxml. Fix GH-51 [kmike] + +* added :meth:`webtest.response.TestResponse.maybe_follow` method [kmike] + +2.0 (2013-02-25) +---------------- + +* drop zc.buildout usage for development, now using only virtualenv + [Domen Kožar] + +* Backward incompatibility : Removed the ``anchor`` argument of + :meth:`webtest.response.TestResponse.click` and the ``button`` argument of + :meth:`webtest.response.TestResponse.clickbutton`. It is for the greater good. + [madjar] + +* Rewrote API documentation [Domen Kožar] + +* Added `wsgiproxy` support to do HTTP request to an URL [gawel] + +* Use BeautifulSoup4 to parse forms [gawel] + +* Added `webtest.app.TestApp.patch_json` [gawel] + +* Implement `webtest.app.TestApp.cookiejar` support and kindof keep + `webtest.app.TestApp.cookies` functionality. `webtest.app.TestApp.cookies` + should be treated as read-only. + [Domen Kožar] + +* Split Selenium integration into separate package webtest-selenium + [gawel] + +* Split casperjs integration into separate package webtest-casperjs + [gawel] + +* Test coverage improvements [harobed, cdevienne, arthru, Domen Kožar, gawel] + +* Fully implement decoding of HTML entities + +* Fix tox configuration + +1.4.2 +----- + +* fix tests error due to CLRF in a tarball + +1.4.1 +----- + +* add travis-ci + +* migrate repository to https://github.com/Pylons/webtest + +* Fix a typo in apps.py: selectedIndicies + +* Preserve field order during parsing (support for deform and such) + +* allow equals sign in the cookie by spliting name-value-string pairs on + the first '=' sign as per + http://tools.ietf.org/html/rfc6265#section-5.2 + +* fix an error when you use AssertionError(response) with unicode chars in + response + +1.4.0 +----- + +* added webtest.ext - allow to use casperjs + +1.3.6 +------ + +* fix `#42 <https://bitbucket.org/ianb/webtest/issue/42>`_ Check uppercase + method. + +* fix `#36 <https://bitbucket.org/ianb/webtest/issue/36>`_ Radio can use forced + value. + +* fix `#24 <https://bitbucket.org/ianb/webtest/issue/24>`_ Include test + fixtures. + +* fix bug when trying to print a response which contain some unicode chars + +1.3.5 +------ + +* fix `#39 <https://bitbucket.org/ianb/webtest/issue/39>`_ Add PATCH to + acceptable methods. + + +1.3.4 +----- + +* fix `#33 <https://bitbucket.org/ianb/webtest/issue/33>`_ Remove + CaptureStdout. Do nothing and break pdb + +* use OrderedDict to store fields in form. See + `#31 <https://bitbucket.org/ianb/webtest/issue/31>`_ + +* fix `#38 <https://bitbucket.org/ianb/webtest/issue/38>`_ Allow to post falsey + values. + +* fix `#37 <https://bitbucket.org/ianb/webtest/issue/37>`_ Allow + Content-Length: 0 without Content-Type + +* `fix #30 <https://bitbucket.org/ianb/webtest/issue/30>`_ bad link to pyquery + documentation + +* Never catch NameError during iteration + +1.3.3 +----- + +* added ``post_json``, ``put_json``, ``delete_json`` + +* fix `#25 <https://bitbucket.org/ianb/webtest/issue/25>`_ params dictionary of + webtest.AppTest.post() does not support unicode values + +1.3.2 +----- + +* improve showbrowser. fixed `#23 <https://bitbucket.org/ianb/webtest/issue/23>`_ + +* print_stderr fail with unicode string on python2 + +1.3.1 +----- + +* Added .option() `#20 <https://bitbucket.org/ianb/webtest/issue/20>`_ + +* Fix #21 + +* Full python3 compat + +1.3 +--- + +* Moved TestApp to app.py + +* Added selenium testing framework. See :mod:`~webtest.sel` module. + + +1.2.4 +------ + +* Accept lists for ``app.post(url, params=[...])`` + +* Allow to use url that starts with the SCRIPT_NAME found in extra_environ + +* Fix `#16 <https://bitbucket.org/ianb/webtest/issue/16>`_ Default + content-type is now correctly set to `application/octet-stream` + +* Fix `#14 and #18 <https://bitbucket.org/ianb/webtest/issue/18>`_ Allow to use + `.delete(params={})` + +* Fix `#12 <https://bitbucket.org/ianb/webtest/issue/12>`_ + + +1.2.3 +----- + +* Fix `#10 + <http://bitbucket.org/ianb/webtest/issue/10/testapprequest-method-overwrites-specifics-with-testapp-scoped>`_, + now `TestApp.extra_environ` doesn't take precedence over a WSGI + environment passed in through the request. + +* Removed stray print + +1.2.2 +----- + +* Revert change to cookies that would add ``"`` around cookie values. + +* Added property :meth:`webtest.Response.pyquery` which returns a + `PyQuery <http://pyquery.org/>`_ object. + +* Set base_url on ``resp.lxml`` + +* Include tests and docs in tarball. + +* Fix sending in webob.Request (or webtest.TestRequest) objects. + +* Fix handling forms with file uploads, when no file is selected. + +* Added ``extra_environ`` argument to :meth:`webtest.TestResponse.click`. + +* Fixed/added wildcard statuses, like ``status="4*"`` + +* Fix file upload fields in forms: allow upload field to be empty. + +* Added support for single-quoted html attributes. + +* `TestResponse` now has unicode support. It is turned on by default + for all responses with charset information. **This is backward + incompatible change** if you rely (e.g. in doctests) on parsed + form fields or responses returned by `json` and `lxml` methods + being encoded strings when charset header is in response. In order + to switch to old behaviour pass `use_unicode=False` flag to + `TestApp` constructor. + + +1.2.1 +----- + +* Added method :meth:`TestApp.request`, which can be used for + sending requests with different methods (e.g., ``MKCOL``). This + method sends all its keyword arguments to + :meth:`webtest.TestRequest.blank` and then executes the request. + The parameters are somewhat different than other methods (like + :meth:`webtest.TestApp.get`), as they match WebOb's attribute + names exactly (the other methods were written before WebOb existed). + +* Removed the copying of stdout to stderr during requests. + +* Fix file upload fields in forms (`#340 + <http://trac.pythonpaste.org/pythonpaste/ticket/340>`_) -- you could + upload files with :meth:`webtest.TestApp.post`, but if you use + ``resp.form`` file upload fields would not work (from rcs-comp.com + and Matthew Desmarais). + +1.2 +--- + +* Fix form inputs; text inputs always default to the empty string, and + unselected radio inputs default to nothing at all. From Daniele + Paolella. + +* Fix following links with fragments (these fragments should not be + sent to the WSGI application). From desmaj. + +* Added ``force_value`` to select fields, like + ``res.form['select'].force_value("new_value")``. This makes it + possible to simulate forms that are dynamically updated. From + Matthew Desmarais. + +* Fixed :meth:`webtest.Response.mustcontain` when you pass in a + ``no=[strings]`` argument. + +1.1 +--- + +* Changed the ``__str__`` of responses to make them more doctest + friendly: + + - All headers are displayed capitalized, like Content-Type + - Headers are sorted alphabetically + +* Changed ``__repr__`` to only show the body length if the complete + body is not shown (for short bodies the complete body is in the + repr) + +* Note: **these are backward incompatible changes** if you are using + doctest (you'll have to update your doctests with the new format). + +* Fixed exception in the ``.delete`` method. + +* Added a ``content_type`` argument to ``app.post`` and ``app.put``, + which sets the ``Content-Type`` of the request. This is more + convenient when testing REST APIs. + +* Skip links in ``<script>...</script>`` tags (since that's not real + markup). + +1.0.2 +----- + +* Don't submit unnamed form fields. + +* Checkboxes with no explicit ``value`` send ``on`` (previously they + sent ``checked``, which isn't what browsers send). + +* Support for ``<select multiple>`` fields (from Matthew Desmarais) + +1.0.1 +--- + +* Fix the ``TestApp`` validator's InputWrapper lacking support for + readline with an argument as needed by the cgi module. + +1.0 +--- + +* Keep URLs in-tact in cases such as + ``app.get('http://www.python.org')`` (so HTTP_HOST=www.python.org, + etc). + +* Fix ``lxml.html`` import, so lxml 2.0 users can get HTML lxml + objects from ``resp.lxml`` + +* Treat ``<input type="image">`` like a submit button. + +* Use ``BaseCookie`` instead of ``SimpleCookie`` for storing cookies + (avoids quoting cookie values). + +* Accept any ``params`` argument that has an ``items`` method (like + MultiDict) + +0.9 +--- + +Initial release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/conf.py new/WebTest-2.0.27/docs/conf.py --- old/WebTest-2.0.23/docs/conf.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/conf.py 2017-03-15 09:18:07.000000000 +0100 @@ -124,7 +124,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/forms.rst new/WebTest-2.0.27/docs/forms.rst --- old/WebTest-2.0.23/docs/forms.rst 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/forms.rst 2017-03-15 09:18:07.000000000 +0100 @@ -43,7 +43,7 @@ .. code-block:: python >>> # dict of fields - >>> form.fields.values() #doctest: +SKIP + >>> form.fields.items() #doctest: +SKIP [(u'text', [<Text name="text">]), ..., (u'submit', [<Submit name="submit">])] You can check the current value: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/index.rst new/WebTest-2.0.27/docs/index.rst --- old/WebTest-2.0.23/docs/index.rst 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/index.rst 2017-03-15 09:18:07.000000000 +0100 @@ -66,7 +66,7 @@ Quick start =========== -The most important object in WebTest is :class:`~webtest.TestApp`, the wrapper +The most important object in WebTest is :class:`~webtest.app.TestApp`, the wrapper for WSGI applications. It also allows you to perform HTTP requests on it. To use it, you simply instantiate it with your WSGI application. @@ -83,7 +83,7 @@ ... start_response('200 OK', headers) ... return [body] -Wrap it into a :class:`~webtest.TestApp`:: +Wrap it into a :class:`~webtest.app.TestApp`:: >>> from webtest import TestApp >>> app = TestApp(application) @@ -107,7 +107,7 @@ >>> resp.mustcontain('<html>') >>> assert 'form' in resp -WebTest can do much more. In particular, it can handle :doc:`forms` and :doc:`json`. +WebTest can do much more. In particular, it can handle :doc:`forms`. Contents diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/testapp.rst new/WebTest-2.0.27/docs/testapp.rst --- old/WebTest-2.0.23/docs/testapp.rst 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/testapp.rst 2017-03-15 09:18:07.000000000 +0100 @@ -10,10 +10,10 @@ app.get('/path', [params], [headers], [extra_environ], ...) -This call to :meth:`~webtest.TestApp.get` does a request for +This call to :meth:`~webtest.app.TestApp.get` does a request for ``/path``, with any params, extra headers or WSGI environment keys that you indicate. This returns a -:class:`~webtest.TestResponse` object, +:class:`~webtest.response.TestResponse` object, based on :class:`webob.response.Response`. It has some additional methods to make it easier to test. @@ -24,7 +24,7 @@ app.post('/path', {'vars': 'values'}, [headers], [extra_environ], [upload_files], ...) -Specifically the second argument of :meth:`~webtest.TestApp.post` +Specifically the second argument of :meth:`~webtest.app.TestApp.post` is the *body* of the request. You can pass in a dictionary (or dictionary-like object), or a string body (dictionary objects are turned into HTML form submissions). @@ -33,8 +33,8 @@ list of ``[(fieldname, filename, field_content)]``. File uploads use a different form submission data type to pass the structured data. -You can use :meth:`~webtest.TestApp.put` and -:meth:`~webtest.TestApp.delete` for PUT and DELETE requests. +You can use :meth:`~webtest.app.TestApp.put` and +:meth:`~webtest.app.TestApp.delete` for PUT and DELETE requests. Making JSON Requests @@ -45,10 +45,10 @@ The ``*_json`` methods will transform data to json before ``POST``/``PUT`` and add the correct ``Content-Type`` for you. -Also Response have an attribute ``.json`` to allow you to retrieve json +Also Response have an attribute :attr:`~webtest.response.TestResponse.json` to allow you to retrieve json contents as a python dict. -Doing *POST* request with :meth:`webtest.TestApp.post_json`: +Doing *POST* request with :meth:`webtest.app.TestApp.post_json`: .. code-block:: python @@ -63,7 +63,7 @@ True -Doing *GET* request with :meth:`webtest.TestApp.get` and using :attr:`webtest.response.json`: +Doing *GET* request with :meth:`webtest.app.TestApp.get` and using :attr:`~webtest.response.TestResponse.json`: To just parse body of the response, use Response.json: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/testapp_fixt.py new/WebTest-2.0.27/docs/testapp_fixt.py --- old/WebTest-2.0.23/docs/testapp_fixt.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/testapp_fixt.py 2017-03-15 09:18:07.000000000 +0100 @@ -20,10 +20,10 @@ body = six.b('<xml><message>hey!</message></xml>') elif req.path_info.endswith('.json'): content_type = 'application/json' - body = json.dumps({"a": 1, "b": 2}) + body = six.b(json.dumps({"a": 1, "b": 2})) elif '/resource/' in req.path_info: content_type = 'application/json' - body = json.dumps(dict(id=1, value='value')) + body = six.b(json.dumps(dict(id=1, value='value'))) resp = Response(body, content_type=content_type) return resp(environ, start_response) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/testresponse.rst new/WebTest-2.0.27/docs/testresponse.rst --- old/WebTest-2.0.23/docs/testresponse.rst 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/testresponse.rst 2017-03-15 09:18:07.000000000 +0100 @@ -33,13 +33,13 @@ ``response.follow(**kw)``: Follows the redirect, returning the new response. It is an error if this response wasn't a redirect. All keyword arguments are - passed to :class:`webtest.TestApp` (e.g., ``status``). Returns + passed to :class:`webtest.app.TestApp` (e.g., ``status``). Returns another response object. ``response.maybe_follow(**kw)``: Follows all redirects; does nothing if this response is not a redirect. All keyword arguments are passed - to :class:`webtest.TestApp` (e.g., ``status``). Returns another + to :class:`webtest.app.TestApp` (e.g., ``status``). Returns another response object. ``x in response``: @@ -62,7 +62,7 @@ `doctest <http://python.org/doc/current/lib/module-doctest.html>`_ ``response.click(description=None, linkid=None, href=None, anchor=None, index=None, verbose=False)``: - Clicks the described link (see :class:`~webtest.TestResponse.click`) + Clicks the described link (see :meth:`~webtest.response.TestResponse.click`) ``response.forms``: Return a dictionary of forms; you can use both indexes (refer to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/docs/testresponse_fixt.py new/WebTest-2.0.27/docs/testresponse_fixt.py --- old/WebTest-2.0.23/docs/testresponse_fixt.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/docs/testresponse_fixt.py 2017-03-15 09:18:07.000000000 +0100 @@ -20,7 +20,7 @@ body = six.b('<xml><message>hey!</message></xml>') elif req.path_info.endswith('.json'): content_type = 'application/json' - body = json.dumps({"a": 1, "b": 2}) + body = six.b(json.dumps({"a": 1, "b": 2})) resp = Response(body, content_type=content_type) return resp(environ, start_response) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/setup.cfg new/WebTest-2.0.27/setup.cfg --- old/WebTest-2.0.23/setup.cfg 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/setup.cfg 2017-03-15 09:18:08.000000000 +0100 @@ -11,7 +11,7 @@ doctest-extension = rst doctest-fixtures = _fixt include = docs -exclude = (CHANGELOG|contributing).rst +exclude = (CHANGELOG|changelog|contributing).rst cover-package = webtest doctest-options = +ELLIPSIS,+NORMALIZE_WHITESPACE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/setup.py new/WebTest-2.0.27/setup.py --- old/WebTest-2.0.23/setup.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/setup.py 2017-03-15 09:18:07.000000000 +0100 @@ -5,7 +5,7 @@ from setuptools import setup from setuptools import find_packages -version = '2.0.23' +version = '2.0.27' install_requires = [ 'six', @@ -19,14 +19,6 @@ 'PasteDeploy', 'WSGIProxy2', 'pyquery' ] -if sys.version_info[0:2] < (2, 7): - install_requires.append('ordereddict') - -if sys.version_info[0:2] <= (2, 7): - tests_require.append('unittest2') -else: - tests_require.append('unittest2py3k') - setup(name='WebTest', version=version, @@ -40,7 +32,6 @@ "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", @@ -67,9 +58,7 @@ test_suite='nose.collector', tests_require=tests_require, extras_require={ - ':python_version=="2.6"': ['ordereddict'], 'tests': tests_require, - 'tests:python_version=="2.6"': ['unittest2'], }, entry_points=""" [paste.app_factory] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/tests/compat.py new/WebTest-2.0.27/tests/compat.py --- old/WebTest-2.0.23/tests/compat.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/tests/compat.py 2017-03-15 09:18:07.000000000 +0100 @@ -1,10 +1,6 @@ # -*- coding: utf-8 -*- -try: - # py < 2.7 - import unittest2 as unittest -except ImportError: - import unittest # noqa +import unittest # noqa try: unicode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/tests/test_app.py new/WebTest-2.0.27/tests/test_app.py --- old/WebTest-2.0.23/tests/test_app.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/tests/test_app.py 2017-03-15 09:18:07.000000000 +0100 @@ -4,7 +4,7 @@ from webob import Response from webtest.compat import to_bytes from webtest.compat import PY3 -from webtest.compat import OrderedDict +from collections import OrderedDict from webtest.debugapp import debug_app from webtest import http from tests.compat import unittest @@ -197,6 +197,13 @@ app.set_cookie('foo', 'bar') app.set_cookie('fizz', ';bar=baz') # Make sure we're escaping. app.get('/') + app.reset() + + app = webtest.TestApp(cookie_app, + extra_environ={'HTTP_HOST': 'testserver'}) + app.set_cookie('foo', 'bar') + app.set_cookie('fizz', ';bar=baz') # Make sure we're escaping. + app.get('/') app.reset() def test_preserves_cookies(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/tests/test_forms.py new/WebTest-2.0.27/tests/test_forms.py --- old/WebTest-2.0.23/tests/test_forms.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/tests/test_forms.py 2017-03-15 09:18:07.000000000 +0100 @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import cgi import os.path import struct import sys @@ -776,9 +777,12 @@ uploaded_files = [(k, v) for k, v in req.POST.items() if 'file' in k] uploaded_files = sorted(uploaded_files) for name, uploaded_file in uploaded_files: - filename = to_bytes(uploaded_file.filename) - value = to_bytes(uploaded_file.value, 'ascii') - content_type = to_bytes(uploaded_file.type, 'ascii') + if isinstance(uploaded_file, cgi.FieldStorage): + filename = to_bytes(uploaded_file.filename) + value = to_bytes(uploaded_file.value, 'ascii') + content_type = to_bytes(uploaded_file.type, 'ascii') + else: + filename = value = content_type = b'' file_parts.append(b""" <p>You selected '""" + filename + b"""'</p> <p>with contents: '""" + value + b"""'</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/tox.ini new/WebTest-2.0.27/tox.ini --- old/WebTest-2.0.23/tox.ini 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/tox.ini 2017-03-15 09:18:07.000000000 +0100 @@ -1,6 +1,6 @@ [tox] skip_missing_interpreters=true -envlist=py26,py27,py33,py34,py35,coverage +envlist=py27,py33,py34,py35,coverage [testenv] setenv = @@ -9,7 +9,7 @@ COVERAGE_FILE=.coverage.{envname} deps = nose<1.3.0 - webtest[tests] + .[tests] lxml pyquery mock @@ -20,7 +20,7 @@ {envbindir}/python --version {envbindir}/pip freeze py{26,27,33}: {envbindir}/nosetests --with-coverage --with-xunit --xunit-file=nosetests-{envname}.xml [] - py{26,27,33}: {envbindir}/coverage xml -o coverage-{envname}.xml + py{27,33}: {envbindir}/coverage xml -o coverage-{envname}.xml py{34,35}: {envbindir}/nosetests [testenv:coverage] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/webtest/app.py new/WebTest-2.0.27/webtest/app.py --- old/WebTest-2.0.23/webtest/app.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/webtest/app.py 2017-03-15 09:18:07.000000000 +0100 @@ -11,7 +11,6 @@ import os import re -import sys import json import random import fnmatch @@ -70,13 +69,13 @@ Domain=localhost.""" def return_ok_domain(self, cookie, request): - if cookie.domain == '.localhost': + if cookie.domain.endswith(request.origin_req_host): return True return http_cookiejar.DefaultCookiePolicy.return_ok_domain( self, cookie, request) def set_ok_domain(self, cookie, request): - if cookie.domain == '.localhost': + if cookie.domain.endswith(request.origin_req_host): return True return http_cookiejar.DefaultCookiePolicy.set_ok_domain( self, cookie, request) @@ -196,7 +195,8 @@ self.authorization_value = value if value is not None: invalid_value = ( - "You should use a value like ('Basic', ('user', 'password')) OR ('Bearer', 'token')" + "You should use a value like ('Basic', ('user', 'password'))" + " OR ('Bearer', 'token') OR ('JWT', 'token')" ) if isinstance(value, (list, tuple)) and len(value) == 2: authtype, val = value @@ -205,7 +205,7 @@ val = ':'.join(list(val)) val = b64encode(to_bytes(val)).strip() val = val.decode('latin1') - elif authtype == 'Bearer' and val and \ + elif authtype in ('Bearer', 'JWT') and val and \ isinstance(val, (str, text_type)): val = val.strip() else: @@ -231,6 +231,9 @@ Sets a cookie to be passed through with requests. """ + cookie_domain = self.extra_environ.get('HTTP_HOST', 'localhost') + cookie_domain = cookie_domain.split(':', 1)[0] + cookie_domain = '.' + cookie_domain value = escape_cookie_value(value) cookie = http_cookiejar.Cookie( version=0, @@ -238,7 +241,7 @@ value=value, port=None, port_specified=False, - domain='.localhost', + domain=cookie_domain, domain_specified=True, domain_initial_dot=False, path='/', @@ -503,6 +506,10 @@ if isinstance(value, forms.File): if value.value: _append_file([key] + list(value.value)) + else: + # If no file was uploaded simulate an empty file with no + # name like real browsers do: + _append_file([key, b'', b'']) elif isinstance(value, forms.Upload): file_info = [key, value.filename] if value.content is not None: @@ -606,7 +613,7 @@ # verify wsgi compatibility app = lint.middleware(self.app) if self.lint else self.app - ## FIXME: should it be an option to not catch exc_info? + # FIXME: should it be an option to not catch exc_info? res = req.get_response(app, catch_exc_info=True) # be sure to decode the content @@ -618,7 +625,7 @@ res.app = app res.test_app = self - # We do this to make sure the app_iter is exausted: + # We do this to make sure the app_iter is exhausted: try: res.body except TypeError: # pragma: no cover @@ -668,7 +675,7 @@ res) if status != res.status_int: raise AppError( - "Bad response: %s (not %s)", res_status, status) + "Bad response: %s (not %s)\n%s", res_status, status, res) def _check_errors(self, res): errors = res.errors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/webtest/compat.py new/WebTest-2.0.27/webtest/compat.py --- old/WebTest-2.0.23/webtest/compat.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/webtest/compat.py 2017-03-15 09:18:07.000000000 +0100 @@ -35,11 +35,6 @@ value = value.encode('utf8') six.print_(value, file=sys.stderr) -try: - from collections import OrderedDict -except ImportError: # pragma: no cover - from ordereddict import OrderedDict # noqa - def escape_cookie_value(value): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/webtest/forms.py new/WebTest-2.0.27/webtest/forms.py --- old/WebTest-2.0.23/webtest/forms.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/webtest/forms.py 2017-03-15 09:18:07.000000000 +0100 @@ -5,7 +5,7 @@ import sys from bs4 import BeautifulSoup -from webtest.compat import OrderedDict +from collections import OrderedDict from webtest import utils @@ -400,11 +400,7 @@ def __init__(self, response, text, parser_features='html.parser'): self.response = response self.text = text - if response and response.charset: - self.html = BeautifulSoup(self.text, parser_features, - from_encoding=response.charset) - else: - self.html = BeautifulSoup(self.text, parser_features) + self.html = BeautifulSoup(self.text, parser_features) attrs = self.html('form')[0].attrs self.action = attrs.get('action', '') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/webtest/response.py new/WebTest-2.0.27/webtest/response.py --- old/WebTest-2.0.23/webtest/response.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/webtest/response.py 2017-03-15 09:18:07.000000000 +0100 @@ -74,7 +74,7 @@ def _parse_forms(self): forms_ = self._forms_indexed = {} - form_texts = [str(f) for f in self.html('form')] + form_texts = [text_type(f) for f in self.html('form')] for i, text in enumerate(form_texts): form = forms.Form(self, text, self.parser_features) forms_[i] = form @@ -426,11 +426,7 @@ raise AttributeError( "Not an HTML response body (content-type: %s)" % self.content_type) - if self.charset: - soup = BeautifulSoup(self.testbody, self.parser_features, - from_encoding=self.charset) - else: - soup = BeautifulSoup(self.testbody, self.parser_features) + soup = BeautifulSoup(self.testbody, self.parser_features) return soup @property @@ -497,17 +493,14 @@ @property def json(self): """ - Return the response as a JSON response. You must have `simplejson - <http://goo.gl/B9g6s>`_ installed to use this, or be using a Python - version with the json module. - + Return the response as a JSON response. The content type must be one of json type to use this. """ if not self.content_type.endswith(('+json', '/json')): raise AttributeError( "Not a JSON response body (content-type: %s)" % self.content_type) - return loads(self.testbody) + return self.json_body @property def pyquery(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WebTest-2.0.23/webtest/utils.py new/WebTest-2.0.27/webtest/utils.py --- old/WebTest-2.0.23/webtest/utils.py 2016-07-21 11:04:01.000000000 +0200 +++ new/WebTest-2.0.27/webtest/utils.py 2017-03-15 09:18:07.000000000 +0100 @@ -97,7 +97,7 @@ """ def __init__(self, request): self._request = request - self.origin_req_host = request.host + self.origin_req_host = request.host.split(':')[0] def is_unverifiable(self): return True # sure? Why not?
