Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pytest-djangoapp for openSUSE:Factory checked in at 2021-05-13 22:18:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-djangoapp (Old) and /work/SRC/openSUSE:Factory/.python-pytest-djangoapp.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-djangoapp" Thu May 13 22:18:47 2021 rev:2 rq:892683 version:0.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-djangoapp/python-pytest-djangoapp.changes 2020-08-10 15:08:03.848283536 +0200 +++ /work/SRC/openSUSE:Factory/.python-pytest-djangoapp.new.2988/python-pytest-djangoapp.changes 2021-05-13 22:18:56.707503802 +0200 @@ -1,0 +2,7 @@ +Thu May 13 12:20:59 UTC 2021 - Mark??ta Machov?? <mmach...@suse.com> + +- Update to 0.15.1 + * Fixture 'request_client' now accepts 'json' argument to encode post data. + * Made Django 3.2 compatible. + +------------------------------------------------------------------- Old: ---- pytest-djangoapp-0.14.0.tar.gz New: ---- pytest-djangoapp-0.15.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-djangoapp.spec ++++++ --- /var/tmp/diff_new_pack.G8jp0Y/_old 2021-05-13 22:18:57.155502243 +0200 +++ /var/tmp/diff_new_pack.G8jp0Y/_new 2021-05-13 22:18:57.155502243 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pytest-djangoapp # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # 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-pytest-djangoapp -Version: 0.14.0 +Version: 0.15.1 Release: 0 Summary: Pytest plugin for Django pluggable application testing License: BSD-3-Clause @@ -29,14 +29,13 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Django -Requires: python-pytest Requires: python-mock +Requires: python-pytest Recommends: python-ipdb BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Django} BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module pytest} # /SECTION %python_subpackages ++++++ pytest-djangoapp-0.14.0.tar.gz -> pytest-djangoapp-0.15.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/AUTHORS new/pytest-djangoapp-0.15.1/AUTHORS --- old/pytest-djangoapp-0.14.0/AUTHORS 2018-06-14 15:30:02.000000000 +0200 +++ new/pytest-djangoapp-0.15.1/AUTHORS 2020-07-30 12:07:08.000000000 +0200 @@ -7,12 +7,4 @@ Contributors ------------ -Here could be your name. - - - -Translators ------------ - -Here could be your name. - +John Vandenberg <https://github.com/jayvdb> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/CHANGELOG new/pytest-djangoapp-0.15.1/CHANGELOG --- old/pytest-djangoapp-0.14.0/CHANGELOG 2020-01-25 09:44:54.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/CHANGELOG 2021-04-10 11:35:34.000000000 +0200 @@ -2,6 +2,16 @@ ========================== +v0.15.1 [2021-04-10] +-------------------- +* Made Django 3.2 compatible. + + +v0.15.0 [2020-09-21] +-------------------- ++ Fixture 'request_client' now accepts 'json' argument to encode post data. + + v0.14.0 [2020-01-25] -------------------- + Added support for testing entire Django projects (requires Py 3). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/LICENSE new/pytest-djangoapp-0.15.1/LICENSE --- old/pytest-djangoapp-0.14.0/LICENSE 2020-01-25 09:34:46.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/LICENSE 2021-04-10 11:33:14.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2018-2020, Igor `idle sign` Starikov +Copyright (c) 2018-2021, Igor `idle sign` Starikov All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/PKG-INFO new/pytest-djangoapp-0.15.1/PKG-INFO --- old/pytest-djangoapp-0.14.0/PKG-INFO 2020-01-25 09:45:05.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/PKG-INFO 2021-04-10 11:35:43.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pytest-djangoapp -Version: 0.14.0 +Version: 0.15.1 Summary: Nice pytest plugin to help you with Django pluggable application testing. Home-page: https://github.com/idlesign/pytest-djangoapp Author: Igor `idle sign` Starikov @@ -87,6 +87,7 @@ pytest_plugins = configure_djangoapp_plugin( settings='myproject.settings.settings_testing', + migrate=False, # If you do not want to apply migrations. ) @@ -94,6 +95,8 @@ What about pytest-django ------------------------ + `pytest-djangoapp` does not depend on `pytest-django`. + There are design decisions in `pytest-django` that might make it uncomfortable to work with. 1. It uses `setuptools` entrypoints feature for `pytest` plugin discovery. It's not a problem by itself, @@ -107,6 +110,19 @@ Despite that `pytest-django` is nice, of course. + `pytest-djangoapp` fixtures allow the use of Django without marking all relevant tests as needing + a database, as is required by pytest-django which provides the ``django_db`` mark and db fixtures. + + If you have `pytest-django` already installed, it can be disabled for projects + using `pytest-djangoapp` by adding the following lines into ``pytest.ini``: + + .. code-block:: ini + + # pytest.ini + [pytest] + addopts = -p no:django + + Documentation ------------- @@ -127,4 +143,5 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: License :: OSI Approved :: BSD License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/README.rst new/pytest-djangoapp-0.15.1/README.rst --- old/pytest-djangoapp-0.14.0/README.rst 2020-01-25 09:42:43.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/README.rst 2021-04-10 11:33:14.000000000 +0200 @@ -79,6 +79,7 @@ pytest_plugins = configure_djangoapp_plugin( settings='myproject.settings.settings_testing', + migrate=False, # If you do not want to apply migrations. ) @@ -86,6 +87,8 @@ What about pytest-django ------------------------ +`pytest-djangoapp` does not depend on `pytest-django`. + There are design decisions in `pytest-django` that might make it uncomfortable to work with. 1. It uses `setuptools` entrypoints feature for `pytest` plugin discovery. It's not a problem by itself, @@ -99,6 +102,19 @@ Despite that `pytest-django` is nice, of course. +`pytest-djangoapp` fixtures allow the use of Django without marking all relevant tests as needing +a database, as is required by pytest-django which provides the ``django_db`` mark and db fixtures. + +If you have `pytest-django` already installed, it can be disabled for projects +using `pytest-djangoapp` by adding the following lines into ``pytest.ini``: + +.. code-block:: ini + + # pytest.ini + [pytest] + addopts = -p no:django + + Documentation ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/docs/source/conf.py new/pytest-djangoapp-0.15.1/docs/source/conf.py --- old/pytest-djangoapp-0.14.0/docs/source/conf.py 2020-01-25 09:34:46.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/docs/source/conf.py 2021-04-10 11:33:14.000000000 +0200 @@ -82,7 +82,7 @@ # General information about the project. project = u'pytest-djangoapp' -copyright = u'2018-2020, Igor `idle sign` Starikov' +copyright = u'2018-2021, Igor `idle sign` Starikov' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/__init__.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/__init__.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/__init__.py 2020-01-25 09:44:54.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/__init__.py 2021-04-10 11:35:34.000000000 +0200 @@ -4,7 +4,7 @@ from .toolbox import configure_djangoapp_plugin -VERSION = (0, 14, 0) +VERSION = (0, 15, 1) """Application version number tuple.""" VERSION_STR = '.'.join(map(str, VERSION)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/configuration.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/configuration.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/configuration.py 2020-01-25 09:34:46.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/configuration.py 2021-04-10 11:33:14.000000000 +0200 @@ -119,6 +119,8 @@ settings_dict = dict( + SECRET_KEY='djangoapp', + ALLOWED_HOSTS=( global_settings.ALLOWED_HOSTS + # Satisfy Django test client needed in Django < 2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/fixtures/request.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/fixtures/request.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/fixtures/request.py 2019-11-23 06:21:55.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/fixtures/request.py 2020-09-21 14:25:01.000000000 +0200 @@ -2,7 +2,6 @@ from __future__ import unicode_literals import pytest - from django.test import RequestFactory, Client try: @@ -13,7 +12,7 @@ if False: # pragma: nocover - from django.contrib.auth.base_user import AbstractBaseUser + from django.contrib.auth.base_user import AbstractBaseUser # noqa from django.http import HttpRequest @@ -24,9 +23,20 @@ class DjangoappRequestFactory(RequestFactory): - def __init__(self, ajax=False, **defaults): + def __init__(self, ajax=False, json=False, **defaults): _contribute_ajax(defaults, ajax) super(DjangoappRequestFactory, self).__init__(**defaults) + self._json = json + + def _encode_json(self, data, content_type): + if self._json: + content_type = 'application/json' + return super(DjangoappRequestFactory, self)._encode_json(data, content_type) + + def _encode_data(self, data, content_type): + if self._json: + content_type = 'application/json' + return super(DjangoappRequestFactory, self)._encode_data(data, content_type) def generic(self, method, path, *args, **kwargs): @@ -38,10 +48,18 @@ class DjagoappClient(Client, DjangoappRequestFactory): - def __init__(self, ajax=False, user=None, enforce_csrf_checks=False, raise_exceptions=True, **defaults): + def __init__( + self, + ajax=False, + user=None, + enforce_csrf_checks=False, + raise_exceptions=True, + json=False, + **defaults + ): _contribute_ajax(defaults, ajax) - super(DjagoappClient, self).__init__(enforce_csrf_checks, **defaults) + super(DjagoappClient, self).__init__(enforce_csrf_checks, json=json, **defaults) if user: assert hasattr(user, 'password_plain'), ( @@ -170,18 +188,27 @@ :param bool ajax: Make AJAX (XMLHttpRequest) requests. + :param AbstractBaseUser user: User to perform queries from. + :param bool raise_exceptions: Do not allow Django technical exception handlers to catch exceptions issued by views, propagate them instead. - :param AbstractBaseUser user: User to perform queries from. + :param bool json: Encode data as JSON. + + .. warning:: To be used with Django 2.1+ :param kwargs: Additional arguments for test client initialization. """ - def request_client_(ajax=False, user=None, raise_exceptions=True, **kwargs): + def request_client_(ajax=False, user=None, raise_exceptions=True, json=False, **kwargs): """ :rtype: DjagoappClient """ - return DjagoappClient(ajax=ajax, user=user, raise_exceptions=raise_exceptions, **kwargs) + return DjagoappClient( + ajax=ajax, + user=user, + raise_exceptions=raise_exceptions, + json=json, + **kwargs) return request_client_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/fixtures/settings.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/fixtures/settings.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/fixtures/settings.py 2019-10-19 05:52:11.000000000 +0200 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/fixtures/settings.py 2020-07-30 12:07:08.000000000 +0200 @@ -38,6 +38,9 @@ proxy.restore_initial() +_PROXY_SETTING_ATTRS = '_settings', '_overridden' + + class SettingsProxy(object): def __init__(self): @@ -46,11 +49,21 @@ def __setattr__(self, name, value): - if name in {'_settings', '_overridden'}: + if name in _PROXY_SETTING_ATTRS: return super(SettingsProxy, self).__setattr__(name, value) self._set(name, value) + def __getattr__(self, name): + + if name in _PROXY_SETTING_ATTRS: + return super(SettingsProxy, self).__getattr__(name) + + try: + return getattr(self._overridden, name) + except AttributeError: + return getattr(self._settings, name) + def __call__(self, **kwargs): # Aid context manager mode. do_set = self._set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/plugin.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/plugin.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/plugin.py 2018-12-31 06:30:16.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/plugin.py 2020-07-30 12:07:08.000000000 +0200 @@ -30,7 +30,7 @@ # e.g. in case of mark.skipif return - call_command('flush', interactive=False) + call_command('flush', interactive=False, reset_sequences=False) teardown_databases(old_config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/test_fixtures_request.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/test_fixtures_request.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/test_fixtures_request.py 2019-11-23 06:19:46.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/test_fixtures_request.py 2020-09-20 15:13:40.000000000 +0200 @@ -41,3 +41,9 @@ client = request_client(raise_exceptions=False) response = client.get('/raiser/') assert b'<h1>Server Error (500)</h1>' in response.content + + # now json + client = request_client(json=True) + response = client.post(('index', {'some_id': 10}), {'a': 'b'}) + content = response.content + assert b'json' in content diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/test_fixtures_settings.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/test_fixtures_settings.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/test_fixtures_settings.py 2018-07-10 15:24:34.000000000 +0200 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/test_fixtures_settings.py 2020-07-30 12:07:08.000000000 +0200 @@ -1,3 +1,4 @@ +import pytest def test_settings(settings): from django.conf import settings as _actual_settings @@ -9,10 +10,18 @@ 'SOMENEW': 'value', }) + assert settings.DEBUG + assert settings.SOMENEW == 'value' + assert _actual_settings.DEBUG + assert _actual_settings.SOMENEW == 'value' settings.SOMENEW = 'other' + assert settings.SOMENEW == 'other' + + assert _actual_settings.SOMENEW == 'other' + def test_context_manager(settings): from django.conf import settings as _actual_settings @@ -20,13 +29,64 @@ assert not _actual_settings.DEBUG with settings(SOME=1, DEBUG=True): + assert settings.SOME == 1 + assert settings.DEBUG + assert _actual_settings.SOME == 1 assert _actual_settings.DEBUG - assert not hasattr(_actual_settings, 'SOME') + settings.OTHER = 1 + assert settings.OTHER == 1 + assert _actual_settings.OTHER == 1 + + assert not hasattr(settings, 'SOME') + assert not hasattr(settings, 'OTHER') + assert not _actual_settings.DEBUG + assert not hasattr(_actual_settings, 'SOME') + assert not hasattr(_actual_settings, 'OTHER') assert 'django.contrib.sites' in _actual_settings.INSTALLED_APPS assert 'django.contrib.sessions.middleware.SessionMiddleware' in _actual_settings.MIDDLEWARE assert 'django.contrib.sessions.middleware.SessionMiddleware' in _actual_settings.MIDDLEWARE_CLASSES assert 'dummy' in _actual_settings.DATABASES + + settings.DEBUG = False + + assert not _actual_settings.DEBUG + + settings.SOME = 2 + + assert settings.SOME == 2 + + assert _actual_settings.SOME == 2 + + with settings(SOME='value', DEBUG=True): + assert settings.SOME == 'value' + assert settings.DEBUG + + assert _actual_settings.SOME == 'value' + assert _actual_settings.DEBUG + + assert not settings.DEBUG + assert not _actual_settings.DEBUG + + # SOME from before the context manager is now removed. + assert not hasattr(settings, 'SOME') + assert not hasattr(_actual_settings, 'SOME') + + with settings: + settings.OTHER = 1 + assert settings.OTHER == 1 + assert _actual_settings.OTHER == 1 + + assert not _actual_settings.DEBUG + + assert not hasattr(settings, 'SOME') + assert not hasattr(settings, 'OTHER') + + assert not hasattr(_actual_settings, 'SOME') + assert not hasattr(_actual_settings, 'OTHER') + + settings.OTHER = 1 + assert settings.OTHER == 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/testapp/urls.py new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/testapp/urls.py --- old/pytest-djangoapp-0.14.0/pytest_djangoapp/tests/testapp/urls.py 2019-12-05 12:05:03.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp/tests/testapp/urls.py 2020-09-21 14:19:52.000000000 +0200 @@ -1,7 +1,6 @@ from django.conf.urls import url from django.http import HttpResponse - from pytest_djangoapp.compat import get_urlpatterns @@ -11,6 +10,9 @@ def index(request, some_id): + if request.method == 'POST': + return HttpResponse('json') + if request.is_ajax(): return HttpResponse('ajaxed') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/pytest_djangoapp.egg-info/PKG-INFO new/pytest-djangoapp-0.15.1/pytest_djangoapp.egg-info/PKG-INFO --- old/pytest-djangoapp-0.14.0/pytest_djangoapp.egg-info/PKG-INFO 2020-01-25 09:45:05.000000000 +0100 +++ new/pytest-djangoapp-0.15.1/pytest_djangoapp.egg-info/PKG-INFO 2021-04-10 11:35:42.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pytest-djangoapp -Version: 0.14.0 +Version: 0.15.1 Summary: Nice pytest plugin to help you with Django pluggable application testing. Home-page: https://github.com/idlesign/pytest-djangoapp Author: Igor `idle sign` Starikov @@ -87,6 +87,7 @@ pytest_plugins = configure_djangoapp_plugin( settings='myproject.settings.settings_testing', + migrate=False, # If you do not want to apply migrations. ) @@ -94,6 +95,8 @@ What about pytest-django ------------------------ + `pytest-djangoapp` does not depend on `pytest-django`. + There are design decisions in `pytest-django` that might make it uncomfortable to work with. 1. It uses `setuptools` entrypoints feature for `pytest` plugin discovery. It's not a problem by itself, @@ -107,6 +110,19 @@ Despite that `pytest-django` is nice, of course. + `pytest-djangoapp` fixtures allow the use of Django without marking all relevant tests as needing + a database, as is required by pytest-django which provides the ``django_db`` mark and db fixtures. + + If you have `pytest-django` already installed, it can be disabled for projects + using `pytest-djangoapp` by adding the following lines into ``pytest.ini``: + + .. code-block:: ini + + # pytest.ini + [pytest] + addopts = -p no:django + + Documentation ------------- @@ -127,4 +143,5 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: License :: OSI Approved :: BSD License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-djangoapp-0.14.0/setup.py new/pytest-djangoapp-0.15.1/setup.py --- old/pytest-djangoapp-0.14.0/setup.py 2019-06-05 13:54:58.000000000 +0200 +++ new/pytest-djangoapp-0.15.1/setup.py 2021-04-10 11:33:14.000000000 +0200 @@ -73,6 +73,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: BSD License' ], )