Hello community,
here is the log from the commit of package python-django-webtest for
openSUSE:Factory checked in at 2019-06-03 18:57:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-webtest (Old)
and /work/SRC/openSUSE:Factory/.python-django-webtest.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-webtest"
Mon Jun 3 18:57:41 2019 rev:3 rq:707112 version:1.9.5
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-webtest/python-django-webtest.changes
2018-12-11 15:49:48.334075762 +0100
+++
/work/SRC/openSUSE:Factory/.python-django-webtest.new.5148/python-django-webtest.changes
2019-06-03 18:57:46.216375445 +0200
@@ -1,0 +2,8 @@
+Mon Jun 3 10:01:30 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.9.5:
+ * Fix compatibility with django 3. See #96
+ * Add integration with django-rest-framework auth
+ * Add missing args to DjangoTestApp. Fixed #86
+
+-------------------------------------------------------------------
Old:
----
django-webtest-1.9.4.tar.gz
New:
----
django-webtest-1.9.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-webtest.spec ++++++
--- /var/tmp/diff_new_pack.kPTXVR/_old 2019-06-03 18:57:47.384375012 +0200
+++ /var/tmp/diff_new_pack.kPTXVR/_new 2019-06-03 18:57:47.384375012 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-django-webtest
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-django-webtest
-Version: 1.9.4
+Version: 1.9.5
Release: 0
Summary: Django integration for WebTest
License: MIT
++++++ django-webtest-1.9.4.tar.gz -> django-webtest-1.9.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/CHANGES.rst
new/django-webtest-1.9.5/CHANGES.rst
--- old/django-webtest-1.9.4/CHANGES.rst 2018-10-27 10:58:09.000000000
+0200
+++ new/django-webtest-1.9.5/CHANGES.rst 2019-05-31 13:37:54.000000000
+0200
@@ -2,6 +2,15 @@
CHANGES
=======
+1.9.5 (2019-05-31)
+------------------
+
+- Fix compatibility with django 3. See #96
+
+- Add integration with django-rest-framework auth
+
+- Add missing args to DjangoTestApp. Fixed #86
+
1.9.4 (2018-10-27)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/PKG-INFO
new/django-webtest-1.9.5/PKG-INFO
--- old/django-webtest-1.9.4/PKG-INFO 2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/PKG-INFO 2019-05-31 13:37:54.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-webtest
-Version: 1.9.4
+Version: 1.9.5
Summary: Instant integration of Ian Bicking's WebTest
(http://docs.pylonsproject.org/projects/webtest/) with django's testing
framework.
Home-page: https://github.com/django-webtest/django-webtest
Author: Mikhail Korobov
@@ -123,6 +123,16 @@
follow links, submit forms, parse html, xml and json responses with
different
parsing libraries, upload files and more.
+ Integration with django-rest-framework
+ ======================================
+
+ If your project uses django-rest-framework__, the setting
+ ``REST_FRAMEWORK['AUTHENTICATION_CLASSES']`` will be patched
+ automatically to include a class that links the rest-framework
+ authentication system with ``app.get(user=user)``.
+
+ .. __: https://www.django-rest-framework.org/
+
Usage with pytest
=================
@@ -184,6 +194,15 @@
CHANGES
=======
+ 1.9.5 (2019-05-31)
+ ------------------
+
+ - Fix compatibility with django 3. See #96
+
+ - Add integration with django-rest-framework auth
+
+ - Add missing args to DjangoTestApp. Fixed #86
+
1.9.4 (2018-10-27)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/README.rst
new/django-webtest-1.9.5/README.rst
--- old/django-webtest-1.9.4/README.rst 2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/README.rst 2019-05-31 13:37:54.000000000 +0200
@@ -115,6 +115,16 @@
follow links, submit forms, parse html, xml and json responses with different
parsing libraries, upload files and more.
+Integration with django-rest-framework
+======================================
+
+If your project uses django-rest-framework__, the setting
+``REST_FRAMEWORK['AUTHENTICATION_CLASSES']`` will be patched
+automatically to include a class that links the rest-framework
+authentication system with ``app.get(user=user)``.
+
+.. __: https://www.django-rest-framework.org/
+
Usage with pytest
=================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/django_webtest/__init__.py
new/django-webtest-1.9.5/django_webtest/__init__.py
--- old/django-webtest-1.9.4/django_webtest/__init__.py 2018-10-27
10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/django_webtest/__init__.py 2019-05-31
13:37:54.000000000 +0200
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
+import copy
+
from django.conf import settings
from django.test.signals import template_rendered
from django.core.handlers.wsgi import WSGIHandler
from django.test import TestCase, TransactionTestCase
from django.test.client import store_rendered_templates
-from django.utils.functional import curry
+
+from functools import partial
try:
from importlib import import_module
@@ -40,9 +43,8 @@
class DjangoTestApp(TestApp):
response_class = DjangoWebtestResponse
- def __init__(self, extra_environ=None, relative_to=None):
- super(DjangoTestApp, self).__init__(self.get_wsgi_handler(),
- extra_environ, relative_to)
+ def __init__(self, *args, **kwargs):
+ super(DjangoTestApp, self).__init__(self.get_wsgi_handler(), *args,
**kwargs)
def get_wsgi_handler(self):
return StaticFilesHandler(WSGIHandler())
@@ -90,7 +92,7 @@
# Curry a data dictionary into an instance of the template renderer
# callback function.
data = {}
- on_template_render = curry(store_rendered_templates, data)
+ on_template_render = partial(store_rendered_templates, data)
template_rendered.connect(on_template_render)
response = super(DjangoTestApp, self).do_request(req, status,
@@ -231,10 +233,13 @@
self._DEBUG_PROPAGATE_EXCEPTIONS = settings.DEBUG_PROPAGATE_EXCEPTIONS
self._MIDDLEWARE = self.settings_middleware[:]
self._AUTHENTICATION_BACKENDS = settings.AUTHENTICATION_BACKENDS[:]
+ self._REST_FRAMEWORK = getattr(
+ settings, 'REST_FRAMEWORK', {'DEFAULT_AUTHENTICATION_CLASSES': []})
self.settings_middleware = list(self.settings_middleware)
settings.AUTHENTICATION_BACKENDS = list(
settings.AUTHENTICATION_BACKENDS)
+ settings.REST_FRAMEWORK = copy.deepcopy(self._REST_FRAMEWORK)
settings.DEBUG_PROPAGATE_EXCEPTIONS = True
if not self.csrf_checks:
@@ -248,11 +253,13 @@
self.settings_middleware = self._MIDDLEWARE
settings.AUTHENTICATION_BACKENDS = self._AUTHENTICATION_BACKENDS
settings.DEBUG_PROPAGATE_EXCEPTIONS = self._DEBUG_PROPAGATE_EXCEPTIONS
+ settings.REST_FRAMEWORK = self._REST_FRAMEWORK
def _setup_auth(self):
''' Setups django-webtest authorization '''
self._setup_auth_middleware()
self._setup_auth_backend()
+ self._setup_auth_class()
def _disable_csrf_checks(self):
disable_csrf_middleware = (
@@ -280,6 +287,11 @@
backend_name = 'django_webtest.backends.WebtestUserBackend'
settings.AUTHENTICATION_BACKENDS.insert(0, backend_name)
+ def _setup_auth_class(self):
+ class_name = 'django_webtest.rest_framework.WebtestAuthentication'
+ auth_classes =
settings.REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES']
+ auth_classes.insert(0, class_name)
+
@property
def middleware_setting_name(self):
try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-webtest-1.9.4/django_webtest/rest_framework.py
new/django-webtest-1.9.5/django_webtest/rest_framework.py
--- old/django-webtest-1.9.4/django_webtest/rest_framework.py 1970-01-01
01:00:00.000000000 +0100
+++ new/django-webtest-1.9.5/django_webtest/rest_framework.py 2019-05-31
13:37:54.000000000 +0200
@@ -0,0 +1,16 @@
+from django.contrib.auth import authenticate
+
+from rest_framework import authentication
+
+
+class WebtestAuthentication(authentication.BaseAuthentication):
+ """Bridge between webtest and django-rest-framework."""
+
+ header = 'WEBTEST_USER'
+
+ def authenticate(self, request):
+ value = request.META.get(self.header)
+ if value:
+ account = authenticate(django_webtest_user=value)
+ if account and account.is_active:
+ return (account, None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-webtest-1.9.4/django_webtest.egg-info/PKG-INFO
new/django-webtest-1.9.5/django_webtest.egg-info/PKG-INFO
--- old/django-webtest-1.9.4/django_webtest.egg-info/PKG-INFO 2018-10-27
10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/django_webtest.egg-info/PKG-INFO 2019-05-31
13:37:54.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-webtest
-Version: 1.9.4
+Version: 1.9.5
Summary: Instant integration of Ian Bicking's WebTest
(http://docs.pylonsproject.org/projects/webtest/) with django's testing
framework.
Home-page: https://github.com/django-webtest/django-webtest
Author: Mikhail Korobov
@@ -123,6 +123,16 @@
follow links, submit forms, parse html, xml and json responses with
different
parsing libraries, upload files and more.
+ Integration with django-rest-framework
+ ======================================
+
+ If your project uses django-rest-framework__, the setting
+ ``REST_FRAMEWORK['AUTHENTICATION_CLASSES']`` will be patched
+ automatically to include a class that links the rest-framework
+ authentication system with ``app.get(user=user)``.
+
+ .. __: https://www.django-rest-framework.org/
+
Usage with pytest
=================
@@ -184,6 +194,15 @@
CHANGES
=======
+ 1.9.5 (2019-05-31)
+ ------------------
+
+ - Fix compatibility with django 3. See #96
+
+ - Add integration with django-rest-framework auth
+
+ - Add missing args to DjangoTestApp. Fixed #86
+
1.9.4 (2018-10-27)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-webtest-1.9.4/django_webtest.egg-info/SOURCES.txt
new/django-webtest-1.9.5/django_webtest.egg-info/SOURCES.txt
--- old/django-webtest-1.9.4/django_webtest.egg-info/SOURCES.txt
2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/django_webtest.egg-info/SOURCES.txt
2019-05-31 13:37:54.000000000 +0200
@@ -12,6 +12,7 @@
django_webtest/middleware.py
django_webtest/pytest_plugin.py
django_webtest/response.py
+django_webtest/rest_framework.py
django_webtest.egg-info/PKG-INFO
django_webtest.egg-info/SOURCES.txt
django_webtest.egg-info/dependency_links.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-webtest-1.9.4/django_webtest_tests/tox2travis.py
new/django-webtest-1.9.5/django_webtest_tests/tox2travis.py
--- old/django-webtest-1.9.4/django_webtest_tests/tox2travis.py 2018-10-27
10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/django_webtest_tests/tox2travis.py 2019-05-31
13:37:54.000000000 +0200
@@ -7,8 +7,6 @@
directories:
- $HOME/.cache/pip
-addons:
- postgresql: "9.3"
services:
- postgresql
before_script:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/setup.py
new/django-webtest-1.9.5/setup.py
--- old/django-webtest-1.9.4/setup.py 2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/setup.py 2019-05-31 13:37:54.000000000 +0200
@@ -4,7 +4,7 @@
from setuptools import setup
-version = '1.9.4'
+version = '1.9.5'
def _read(name):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-webtest-1.9.4/tox.ini
new/django-webtest-1.9.5/tox.ini
--- old/django-webtest-1.9.4/tox.ini 2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.5/tox.ini 2019-05-31 13:37:54.000000000 +0200
@@ -1,19 +1,17 @@
[tox]
skip_missing_interpreters = true
envlist =
- pypy-django19-std,
- py27-django{19,110,111}-{std,clocale,postgres},
- {py35,py36,py37}-django{19,110,111,20}-{std,clocale,postgres}
+ py27-django{111}-{std,clocale,postgres},
+ {py35,py36,py37}-django{111,20,21}-{std,clocale,postgres}
[testenv]
deps=
pytest
pytest-django
postgres: psycopg2
- django19: django >=1.9, < 1.9.9
- django110: django >=1.10, < 1.11
django111: django >=1.11, < 2.0
- django20: django ~= 2.0
+ django20: django >=2.0, <=2.1
+ django21: django >=2.1, <=2.2
setenv=
clocale: LC_ALL=C
postgres: USE_POSTGRES=True