summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-01-15 13:24:35 +0100
committerGyorgy Sarvari <skandigraun@gmail.com>2026-01-17 13:45:38 +0100
commitc8b4a0b77527389bbc9e9d440da425f92bf6037b (patch)
tree1e978a59020aa57f5d49e6bcb7215245d95cc095 /meta-python/recipes-devtools
parent08466c714f4419eba5247a2215a9ae0c7ebb3d99 (diff)
downloadmeta-openembedded-c8b4a0b77527389bbc9e9d440da425f92bf6037b.tar.gz
python3-django: (v3.2.25) fix tests
These patches are for python3-django_3.2.25 These patches only touch the tests folder, which is normally not installed. Most of these changes are backported patches, that adapt tests to modern(er) Python environment than they were written for, and some other just fix a bug in the tests that were always present. 0001-Fix-tag_strip-tests.patch: The html parser's behavior in Python has changed, making this testcase fail. This is a partial backport of the patch, which handles only the Python version that is shipped with oe-core (The original patch handles both old and new versions) 0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch: this backported patch makes a test-verification conform to html5 standard. Previously the test failed. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools')
-rw-r--r--meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fix-tag_strip-tests.patch37
-rw-r--r--meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch32
-rw-r--r--meta-python/recipes-devtools/python/python3-django_3.2.25.bb2
3 files changed, 71 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fix-tag_strip-tests.patch b/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fix-tag_strip-tests.patch
new file mode 100644
index 0000000000..c99242e348
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fix-tag_strip-tests.patch
@@ -0,0 +1,37 @@
1From bd3ffbbacceef7fabd3135ca90eba1397e2b5901 Mon Sep 17 00:00:00 2001
2From: Your Name <you@example.com>
3Date: Tue, 13 Jan 2026 20:07:35 +0000
4Subject: [PATCH] Fix tag_strip tests
5
6Python's htmlparser behavior changed between python versions, and
7the tests expect incorrect result due to this.
8
9This patch is a partial backport, to use only the results that are
10valid for the OE Python version.
11
12Upstream-Status: Backport [https://github.com/django/django/commit/2980627502c84a9fd09272e1349dc574a2ff1fb1]
13Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
14---
15 tests/utils_tests/test_html.py | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
19index 86f5562..71757ad 100644
20--- a/tests/utils_tests/test_html.py
21+++ b/tests/utils_tests/test_html.py
22@@ -91,10 +91,10 @@ class TestUtilsHtml(SimpleTestCase):
23 ('&gotcha&#;<>', '&gotcha&#;<>'),
24 ('<sc<!-- -->ript>test<<!-- -->/script>', 'ript>test'),
25 ('<script>alert()</script>&h', 'alert()h'),
26- ('><!' + ('&' * 16000) + 'D', '><!' + ('&' * 16000) + 'D'),
27+ ('><!' + ('&' * 16000) + 'D', '>'),
28 ('X<<<<br>br>br>br>X', 'XX'),
29 ("<" * 50 + "a>" * 50, ""),
30- (">" + "<a" * 500 + "a", ">" + "<a" * 500 + "a"),
31+ (">" + "<a" * 500 + "a", ">"),
32 ("<a" * 49 + "a" * 951, "<a" * 49 + "a" * 951),
33 ("<" + "a" * 1_002, "<" + "a" * 1_002),
34 )
35--
362.39.5
37
diff --git a/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch b/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch
new file mode 100644
index 0000000000..83975c8f75
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-django-3.2.25/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch
@@ -0,0 +1,32 @@
1From 744927154e6748db08f5232de78ee0d4a8be61a5 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Mon, 21 Jul 2025 15:23:32 -0300
4Subject: [PATCH] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
5 following Python's HTMLParser fixed parsing.
6
7From: Natalia <124304+nessita@users.noreply.github.com>
8
9Further details about Python changes can be found in:
10https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.
11
12Thank you Clifford Gama for the thorough review!
13
14Upstream-Status: Backport [https://github.com/django/django/commit/e4515dad7a6d953c0bd2414127ba36e1446ff41a]
15Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
16---
17 tests/test_utils/tests.py | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
21index a1a113a..d1a1e35 100644
22--- a/tests/test_utils/tests.py
23+++ b/tests/test_utils/tests.py
24@@ -848,7 +848,7 @@ class HTMLEqualTests(SimpleTestCase):
25 "('Unexpected end tag `div` (Line 1, Column 6)', (1, 6))"
26 )
27 with self.assertRaisesMessage(AssertionError, error_msg):
28- self.assertHTMLEqual('< div></ div>', '<div></div>')
29+ self.assertHTMLEqual('< div></div>', '<div></div>')
30 with self.assertRaises(HTMLParseError):
31 parse_html('</p>')
32
diff --git a/meta-python/recipes-devtools/python/python3-django_3.2.25.bb b/meta-python/recipes-devtools/python/python3-django_3.2.25.bb
index 15ee178115..8d2be3702f 100644
--- a/meta-python/recipes-devtools/python/python3-django_3.2.25.bb
+++ b/meta-python/recipes-devtools/python/python3-django_3.2.25.bb
@@ -16,6 +16,8 @@ SRC_URI += "\
16 file://CVE-2024-53907.patch \ 16 file://CVE-2024-53907.patch \
17 file://CVE-2025-32873.patch \ 17 file://CVE-2025-32873.patch \
18 file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \ 18 file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \
19 file://0001-Fix-tag_strip-tests.patch \
20 file://0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch \
19" 21"
20 22
21# Set DEFAULT_PREFERENCE so that the LTS version of django is built by 23# Set DEFAULT_PREFERENCE so that the LTS version of django is built by