- Add few patches to fix tests (from gh#flask-admin/flask-admin#2328): * model-from-model.patch * reverse-relation-for-model.patch * bytes-not-str OBS-URL: https://build.opensuse.org/request/show/1119979 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:flask/python-Flask-Admin?expand=0&rev=33
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From 11b657cd886f18ad186eb8cf5401b00bcba0f842 Mon Sep 17 00:00:00 2001
|
|
From: Chris Mayo <aklhfex@gmail.com>
|
|
Date: Mon, 23 Oct 2023 19:22:07 +0100
|
|
Subject: [PATCH] Fix test_file_admin: "a bytes-like object is required, not
|
|
'str'"
|
|
|
|
---
|
|
flask_admin/tests/fileadmin/test_fileadmin.py | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
Index: Flask-Admin-1.6.1/flask_admin/tests/fileadmin/test_fileadmin.py
|
|
===================================================================
|
|
--- Flask-Admin-1.6.1.orig/flask_admin/tests/fileadmin/test_fileadmin.py
|
|
+++ Flask-Admin-1.6.1/flask_admin/tests/fileadmin/test_fileadmin.py
|
|
@@ -1,3 +1,4 @@
|
|
+from io import BytesIO
|
|
import os
|
|
import os.path as op
|
|
import unittest
|
|
@@ -80,7 +81,7 @@ class Base:
|
|
assert rv.status_code == 200
|
|
|
|
rv = client.post('/admin/myfileadmin/upload/',
|
|
- data=dict(upload=(StringIO(""), 'dummy.txt')))
|
|
+ data=dict(upload=(BytesIO("".encode("utf8")), 'dummy.txt')))
|
|
assert rv.status_code == 302
|
|
|
|
rv = client.get('/admin/myfileadmin/')
|