diff --git a/django_4.patch b/django_4.patch new file mode 100644 index 0000000..bd3f57a --- /dev/null +++ b/django_4.patch @@ -0,0 +1,29 @@ +--- + pytest_djangoapp/tests/testapp/urls.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/pytest_djangoapp/tests/testapp/urls.py ++++ b/pytest_djangoapp/tests/testapp/urls.py +@@ -1,4 +1,4 @@ +-from django.conf.urls import url ++from django.urls import re_path as url + from django.http import HttpResponse + + from pytest_djangoapp.compat import get_urlpatterns +@@ -7,13 +7,15 @@ from pytest_djangoapp.compat import get_ + def raise_exception(request): + raise Exception('This one should be handled by 500 technical view') + ++def is_ajax(req): ++ return req.headers.get('x-requested-with') == 'XMLHttpRequest' + + def index(request, some_id): + + if request.method == 'POST': + return HttpResponse('json') + +- if request.is_ajax(): ++ if is_ajax(request): + return HttpResponse('ajaxed') + + from django.templatetags.static import static diff --git a/pytest-djangoapp-0.15.1.tar.gz b/pytest-djangoapp-0.15.1.tar.gz deleted file mode 100644 index 744883e..0000000 --- a/pytest-djangoapp-0.15.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ed10b80ca3bf4c7eb55be209c438582ca6599691d58643d75a5f6f1e7170b149 -size 26790 diff --git a/pytest-djangoapp-0.15.2.tar.gz b/pytest-djangoapp-0.15.2.tar.gz new file mode 100644 index 0000000..195ddad --- /dev/null +++ b/pytest-djangoapp-0.15.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feebdfbed7d919df2b5050c0b40205dfd7896d0d106c378f1111343a5d6f8066 +size 26901 diff --git a/python-pytest-djangoapp.changes b/python-pytest-djangoapp.changes index 4ee805e..e461ac9 100644 --- a/python-pytest-djangoapp.changes +++ b/python-pytest-djangoapp.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Jan 10 20:59:26 UTC 2022 - Matej Cepl + +- Update to 0.15.2: + - Ignore temporary attributes from project settings module (see + gh#idlesign/pytest-djangoapp#21). +- Add django_4.patch making the package compatible with Django + 4.* (gh#idlesign/pytest-djangoapp#23). + ------------------------------------------------------------------- Thu May 13 12:20:59 UTC 2021 - Markéta Machová diff --git a/python-pytest-djangoapp.spec b/python-pytest-djangoapp.spec index c5c92e2..73d5817 100644 --- a/python-pytest-djangoapp.spec +++ b/python-pytest-djangoapp.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-djangoapp # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,16 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytest-djangoapp -Version: 0.15.1 +Version: 0.15.2 Release: 0 Summary: Pytest plugin for Django pluggable application testing License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/idlesign/pytest-djangoapp Source: https://files.pythonhosted.org/packages/source/p/pytest-djangoapp/pytest-djangoapp-%{version}.tar.gz +# PATCH-FIX-UPSTREAM django_4.patch gh#idlesign/pytest-djangoapp#23 mcepl@suse.com +# this patch makes things totally awesome +Patch0: django_4.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -44,8 +47,9 @@ BuildRequires: %{python_module pytest} A pytest plugin to help with Django pluggable application testing. %prep -%setup -q -n pytest-djangoapp-%{version} -# https://github.com/idlesign/pytest-djangoapp/issues/4 +%autosetup -p1 -n pytest-djangoapp-%{version} + +# gh#idlesign/pytest-djangoapp#4 mv ./pytest_djangoapp/tests/conftest.py . %build