Hello community,

here is the log from the commit of package python-django-webtest for 
openSUSE:Leap:15.2 checked in at 2020-02-23 16:47:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-django-webtest (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-django-webtest.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django-webtest"

Sun Feb 23 16:47:36 2020 rev:12 rq:776584 version:1.9.7

Changes:
--------
--- 
/work/SRC/openSUSE:Leap:15.2/python-django-webtest/python-django-webtest.changes
    2020-01-15 15:48:41.671434612 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.python-django-webtest.new.26092/python-django-webtest.changes
 2020-02-23 16:47:37.214337813 +0100
@@ -1,0 +2,20 @@
+Mon Sep 16 08:47:21 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.9.7:
+  * allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102
+
+-------------------------------------------------------------------
+Mon Jun 17 12:03:44 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.9.6:
+  * rest_framework auth class. Fixed #98 #100
+
+-------------------------------------------------------------------
+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.7.tar.gz

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

Other differences:
------------------
++++++ python-django-webtest.spec ++++++
--- /var/tmp/diff_new_pack.O3BUDy/_old  2020-02-23 16:47:37.558338475 +0100
+++ /var/tmp/diff_new_pack.O3BUDy/_new  2020-02-23 16:47:37.562338482 +0100
@@ -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.7
 Release:        0
 Summary:        Django integration for WebTest
 License:        MIT

++++++ django-webtest-1.9.4.tar.gz -> django-webtest-1.9.7.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.7/CHANGES.rst
--- old/django-webtest-1.9.4/CHANGES.rst        2018-10-27 10:58:09.000000000 
+0200
+++ new/django-webtest-1.9.7/CHANGES.rst        2019-07-05 17:51:39.000000000 
+0200
@@ -2,6 +2,27 @@
 CHANGES
 =======
 
+1.9.7 (2019-07-05)
+------------------
+
+- allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102
+
+
+1.9.6 (2019-06-07)
+------------------
+
+- rest_framework auth class. Fixed #98 #100
+
+
+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.7/PKG-INFO
--- old/django-webtest-1.9.4/PKG-INFO   2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.7/PKG-INFO   2019-07-05 17:51:39.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-webtest
-Version: 1.9.4
+Version: 1.9.7
 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,27 @@
         CHANGES
         =======
         
+        1.9.7 (2019-07-05)
+        ------------------
+        
+        - allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102
+        
+        
+        1.9.6 (2019-06-07)
+        ------------------
+        
+        - rest_framework auth class. Fixed #98 #100
+        
+        
+        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.7/README.rst
--- old/django-webtest-1.9.4/README.rst 2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.7/README.rst 2019-07-05 17:51:39.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.7/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.7/django_webtest/__init__.py 2019-07-05 
17:51:39.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,11 @@
 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):
+        extra_environ = kwargs.get('extra_environ', {}).copy()
+        extra_environ.setdefault('HTTP_HOST', 'testserver')
+        kwargs['extra_environ'] = extra_environ
+        super(DjangoTestApp, self).__init__(self.get_wsgi_handler(), *args, 
**kwargs)
 
     def get_wsgi_handler(self):
         return StaticFilesHandler(WSGIHandler())
@@ -56,7 +61,6 @@
 
     def _update_environ(self, environ, user=_notgiven):
         environ = environ or {}
-        environ.setdefault('HTTP_HOST', 'testserver')
 
         if user is not _notgiven:
             if user is None:
@@ -90,7 +94,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 +235,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 +255,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 +289,19 @@
         backend_name = 'django_webtest.backends.WebtestUserBackend'
         settings.AUTHENTICATION_BACKENDS.insert(0, backend_name)
 
+    def _setup_auth_class(self):
+        class_name = 'django_webtest.rest_framework_auth.WebtestAuthentication'
+        drf_settings = settings.REST_FRAMEWORK
+        try:
+            classes = drf_settings['DEFAULT_AUTHENTICATION_CLASSES']
+        except KeyError:
+            classes = []
+        if class_name not in classes:
+            if isinstance(classes, tuple):
+                classes = list(classes)
+            classes.insert(0, class_name)
+            drf_settings['DEFAULT_AUTHENTICATION_CLASSES'] = classes
+
     @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_auth.py 
new/django-webtest-1.9.7/django_webtest/rest_framework_auth.py
--- old/django-webtest-1.9.4/django_webtest/rest_framework_auth.py      
1970-01-01 01:00:00.000000000 +0100
+++ new/django-webtest-1.9.7/django_webtest/rest_framework_auth.py      
2019-07-05 17:51:39.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.7/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.7/django_webtest.egg-info/PKG-INFO   2019-07-05 
17:51:39.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-webtest
-Version: 1.9.4
+Version: 1.9.7
 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,27 @@
         CHANGES
         =======
         
+        1.9.7 (2019-07-05)
+        ------------------
+        
+        - allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102
+        
+        
+        1.9.6 (2019-06-07)
+        ------------------
+        
+        - rest_framework auth class. Fixed #98 #100
+        
+        
+        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.7/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.7/django_webtest.egg-info/SOURCES.txt        
2019-07-05 17:51:39.000000000 +0200
@@ -12,6 +12,7 @@
 django_webtest/middleware.py
 django_webtest/pytest_plugin.py
 django_webtest/response.py
+django_webtest/rest_framework_auth.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.7/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.7/django_webtest_tests/tox2travis.py 2019-07-05 
17:51:39.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.7/setup.py
--- old/django-webtest-1.9.4/setup.py   2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.7/setup.py   2019-07-05 17:51:39.000000000 +0200
@@ -4,7 +4,7 @@
 from setuptools import setup
 
 
-version = '1.9.4'
+version = '1.9.7'
 
 
 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.7/tox.ini
--- old/django-webtest-1.9.4/tox.ini    2018-10-27 10:58:09.000000000 +0200
+++ new/django-webtest-1.9.7/tox.ini    2019-07-05 17:51:39.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


Reply via email to