Notification time stamped 2021-03-31 17:01:14 UTC
From 879152a8589f30364726b5c8373f157c95bedc0c Mon Sep 17 00:00:00 2001
From: František Zatloukal <fzatlouk(a)redhat.com>
Date: May 07 2020 16:21:08 +0000
Subject: Fix tests with python3-werkzeug >= 1.0
---
diff --git a/862.patch b/862.patch
new file mode 100644
index 0000000..1eb6421
--- /dev/null
+++ b/862.patch
@@ -0,0 +1,41 @@
+From 7437d53e12b08099586546f999fbdf3cf080330b Mon Sep 17 00:00:00 2001
+From: Anthony Sottile <asottile(a)umich.edu>
+Date: Fri, 7 Feb 2020 09:59:23 -0800
+Subject: [PATCH] Fix testsuite for werkzeug 1.x
+
+---
+ tests/test_api.py | 4 +++-
+ tests/test_reqparse.py | 4 ++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_api.py b/tests/test_api.py
+index f7f8e661..6795d362 100644
+--- a/tests/test_api.py
++++ b/tests/test_api.py
+@@ -445,7 +445,9 @@ def test_handle_non_api_error(self):
+
+ resp = app.get("/foo")
+ self.assertEquals(resp.status_code, 404)
+- self.assertEquals('text/html', resp.headers['Content-Type'])
++ # in newer versions of werkzeug this is `text/html; charset=utf8`
++ content_type, _, _ =
resp.headers['Content-Type'].partition(';')
++ self.assertEquals('text/html', content_type)
+
+ def test_non_api_error_404_catchall(self):
+ app = Flask(__name__)
+diff --git a/tests/test_reqparse.py b/tests/test_reqparse.py
+index 2f1fbedf..9776f17c 100644
+--- a/tests/test_reqparse.py
++++ b/tests/test_reqparse.py
+@@ -2,9 +2,9 @@
+ import unittest
+ from mock import Mock, patch
+ from flask import Flask
+-from werkzeug import exceptions, MultiDict
++from werkzeug import exceptions
+ from werkzeug.wrappers import Request
+-from werkzeug.datastructures import FileStorage
++from werkzeug.datastructures import FileStorage, MultiDict
+ from flask_restful.reqparse import Argument, RequestParser, Namespace
+ import six
+ import decimal
diff --git a/python-flask-restful.spec b/python-flask-restful.spec
index 3932d80..39d03b7 100644
--- a/python-flask-restful.spec
+++ b/python-flask-restful.spec
@@ -3,13 +3,15 @@
Name: python-%{srcname}
Version: 0.3.8
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: %{sum}
License: BSD
URL:
https://www.github.com/%{srcname}/%{srcname}/
Source0:
https://github.com/%{srcname}/%{srcname}/archive/%{version}.tar.gz
+Patch0: 862.patch
+
BuildArch: noarch
BuildRequires: python3-flask
@@ -42,6 +44,7 @@ that works with your existing ORM/libraries.
%prep
%setup -qn %{srcname}-%{version}
+%patch0 -p1
rm -rf docs/_themes/.gitignore
%build
@@ -60,6 +63,9 @@ rm -rf docs/_themes/.gitignore
%{python3_sitelib}/Flask_RESTful-*.egg-info/
%changelog
+* Thu May 07 2020 Frantisek Zatloukal <fzatlouk(a)redhat.com> - 0.3.8-2
+- Fix tests with python3-werkzeug >= 1.0
+
* Fri Feb 07 2020 Frantisek Zatloukal <fzatlouk(a)redhat.com> - 0.3.8-1
- Release 0.3.8
https://src.fedoraproject.org/rpms/python-flask-restful/c/879152a8589f303...