Skip to contentSkip to conversation

exiv2: add ptest support

PATCH New Gyorgy Sarvari 1 participant 5 messages Jan 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 exiv2: add ptest support

The project has extensive runtime- and unittest suite - make use of it.

It takes around 10 seconds to run both suites.

Added two patches:
One is needed to convert python unittest output into automake output.

The other is required to be able to configure test data folder at compile time - otherwise the tests are looking for the test-data with absolute paths from the build machine.

(cherry picked from commit 35bc4860f18cd56a80ee29d492540acfcb620b59)

Adapted to Kirkstone. (It also required an extra patch to be able to compile with the current googletest library)

---
 ...1-Allow-test-data-path-configuration.patch | 30 ++++++++++++++++
 .../0001-Fix-build-with-gtest-1.11.patch      | 35 +++++++++++++++++++
 meta-oe/recipes-support/exiv2/exiv2/run-ptest |  6 ++++
 meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb | 33 +++++++++++++++--
 4 files changed, 102 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/0001-Allow-test-data-path-configuration.patch
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/0001-Fix-build-with-gtest-1.11.patch
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/run-ptest
meta-oe/recipes-support/exiv2/exiv2/0001-Allow-test-data-path-configuration.patch new file +30 -0
new file mode 100644
index 0000000000..9d6072a799
@@ -0,0 +1,30 @@
+From 2483e51df6e02ad0ad5ae636767279fa230da44f Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Sun, 23 Nov 2025 11:52:24 +0100
+Subject: [PATCH] Allow test data path configuration
+
+The unittests expect to the executed in the source folder before/after build,
+and they expect the test data to be in the source folder. However for ptests
+these folders are not available.
+
+This patch allows the test data folders to be configuration during build time.
+
+Upstream-Status: Inappropriate [ptest-specific]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ unitTests/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unitTests/CMakeLists.txt b/unitTests/CMakeLists.txt
+index 51040c0e2..e2604d4a7 100644
+--- a/unitTests/CMakeLists.txt
++++ b/unitTests/CMakeLists.txt
+@@ -40,7 +40,7 @@ add_executable(unit_tests
+ target_compile_definitions(unit_tests
+   PRIVATE
+     exiv2lib_STATIC
+-    TESTDATA_PATH="${PROJECT_SOURCE_DIR}/test/data"
++    TESTDATA_PATH="${TEST_FOLDER}/test/data"
+ )
+ 
+ if (exiv2lib_COMPILE_DEFINITIONS)
meta-oe/recipes-support/exiv2/exiv2/0001-Fix-build-with-gtest-1.11.patch new file +35 -0
new file mode 100644
index 0000000000..fd4c88f062
@@ -0,0 +1,35 @@
+From 14d482f9e2353e195149fff196e65cb3a6b46e25 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Fri, 18 Jun 2021 18:53:46 +0200
+Subject: [PATCH] Fix build with gtest 1.11
+
+From: Antonio Rojas <[email protected]>
+
+INSTANTIATE_TYPED_TEST_CASE_P requires a non-empty prefix now
+
+Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/c069e36605f05e8e58bf964e5ecbde04efb90a20]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ unitTests/test_slice.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/unitTests/test_slice.cpp b/unitTests/test_slice.cpp
+index bbc6785..ab51cda 100644
+--- a/unitTests/test_slice.cpp
++++ b/unitTests/test_slice.cpp
+@@ -422,12 +422,12 @@ REGISTER_TYPED_TEST_CASE_P(slice, atAccess, iteratorAccess, constructionFailsFro
+                            constMethodsPreserveConst);
+ 
+ typedef ::testing::Types<const std::vector<int>, std::vector<int>, int*, const int*> test_types_t;
+-INSTANTIATE_TYPED_TEST_CASE_P(, slice, test_types_t);
++INSTANTIATE_TYPED_TEST_CASE_P(slice, slice, test_types_t);
+ 
+ REGISTER_TYPED_TEST_CASE_P(mutableSlice, iterators, at);
+ typedef ::testing::Types<std::vector<int>, int*> mut_test_types_t;
+-INSTANTIATE_TYPED_TEST_CASE_P(, mutableSlice, mut_test_types_t);
++INSTANTIATE_TYPED_TEST_CASE_P(slice, mutableSlice, mut_test_types_t);
+ 
+ REGISTER_TYPED_TEST_CASE_P(dataBufSlice, successfulConstruction, failedConstruction);
+ typedef ::testing::Types<DataBuf&, const DataBuf&> data_buf_types_t;
+-INSTANTIATE_TYPED_TEST_CASE_P(, dataBufSlice, data_buf_types_t);
++INSTANTIATE_TYPED_TEST_CASE_P(slice, dataBufSlice, data_buf_types_t);
meta-oe/recipes-support/exiv2/exiv2/run-ptest new file +6 -0
new file mode 100644
index 0000000000..d7ed07d7c9
@@ -0,0 +1,6 @@
+#!/bin/sh
+cd tests
+python3 ./runner.py -v 2>&1 | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
+
+cd ..
+./build/bin/unit_tests --gtest_print_time=0 | sed -E  '/^\[ RUN/d ; s/\[       OK \]/PASS: / ; s/\[ DISABLED \]/SKIP: / ; s/\[ FAILED \]/FAIL: /'
meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb +31 -2
index 1c1c05dfaa..0b70c3b235 100644
@@ -2,10 +2,13 @@ SUMMARY = "Exif, Iptc and XMP metadata manipulation library and tools"
 LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=625f055f41728f84a8d7938acc35bdc2"
 
-DEPENDS = "zlib expat"
+DEPENDS = "zlib expat ${@bb.utils.contains('PTEST_ENABLED', '1', 'googletest', '', d)}"
 
 SRC_URI = "https://github.com/Exiv2/${BPN}/releases/download/v${PV}/${BP}-Source.tar.gz \
+           file://run-ptest \
+           file://0001-Allow-test-data-path-configuration.patch \
            file://0001-Use-compiler-fcf-protection-only-if-compiler-arch-su.patch \
+           file://0001-Fix-build-with-gtest-1.11.patch \
            file://CVE-2021-29457.patch \
            file://CVE-2021-29458.patch \
            file://CVE-2021-29463.patch \
@@ -26,8 +29,34 @@ SRC_URI = "https://github.com/Exiv2/${BPN}/releases/download/v${PV}/${BP}-Source
 SRC_URI[sha256sum] = "a79f5613812aa21755d578a297874fb59a85101e793edc64ec2c6bd994e3e778"
 
 # Once patch is obsolete (project should be aware due to PRs), dos2unix can be removed either
-inherit dos2unix
+inherit dos2unix ptest
 
 S = "${WORKDIR}/${BPN}-${PV}-Source"
 
 inherit cmake gettext
+
+RDEPENDS:${PN}-ptest += " \
+    python3-html \
+    python3-lxml \
+    python3-multiprocessing \
+    python3-shell \
+    python3-unittest"
+
+EXTRA_OECMAKE = "\
+    ${@bb.utils.contains('PTEST_ENABLED', \
+    '1', \
+    '-DEXIV2_BUILD_SAMPLES=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DTEST_FOLDER=${PTEST_PATH}', \
+    '', \
+    d)} \
+"
+
+do_install_ptest(){
+    cp -r ${S}/tests ${D}${PTEST_PATH}/
+    cp -r ${S}/test ${D}${PTEST_PATH}/
+
+    install -d ${D}${PTEST_PATH}/build/bin
+    install ${B}/bin/* ${D}${PTEST_PATH}/build/bin
+
+    install -d ${D}${PTEST_PATH}/src
+    install ${S}/src/canonmn_int.cpp ${D}${PTEST_PATH}/src
+}
#1 lore raw

PATCH 2/5 python3-django: handle non-existing import from CVE patch

This change is for python3-django_2.2.28.

During backporting a patch for CVE-2024-56374, an import got into the patch for v2.2.28 that does not exist yet in that version.

This patch handles this import with a fallback to prevent throwing and ImportError.

---
 .../python3-django/0001-fix-ipv6-test.patch   | 34 +++++++++++++++++++
 .../python/python3-django_2.2.28.bb           |  3 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-fix-ipv6-test.patch
meta-python/recipes-devtools/python/python3-django/0001-fix-ipv6-test.patch new file +34 -0
new file mode 100644
index 0000000000..57f2a073cc
@@ -0,0 +1,34 @@
+From b56516c12f05cf56e65cc960f865d5ebdae733e2 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Wed, 14 Jan 2026 11:05:36 +0100
+Subject: [PATCH] fix ipv6 test
+
+During backporting a patch for CVE-2024-56374, an import got into
+the patch for v2.2.28 that does not exist yet in that version.
+
+This patch handles this import with a fallback to prevent throwing
+and ImportError.
+
+Upstream-Status: Inappropriate [Backport specific]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ tests/utils_tests/test_ipv6.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tests/utils_tests/test_ipv6.py b/tests/utils_tests/test_ipv6.py
+index 1ac6763..3b21948 100644
+--- a/tests/utils_tests/test_ipv6.py
++++ b/tests/utils_tests/test_ipv6.py
+@@ -8,8 +8,10 @@ from django.utils.ipv6 import (
+     clean_ipv6_address,
+     is_valid_ipv6_address,
+ )
+-from django.utils.version import PY310
+-
++try:
++    from django.utils.version import PY310
++except ImportError:
++    PY310 = None
+ 
+ class TestUtilsIPv6(SimpleTestCase):
+ 
meta-python/recipes-devtools/python/python3-django_2.2.28.bb +2 -1
index 3b5491cd5e..3dd64a5507 100644
@@ -36,7 +36,8 @@ SRC_URI += "file://CVE-2023-31047.patch \
             file://Fix-missing-JSONField-in-django.db.mo.patch \
             file://0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch \
             file://0001-implement-group-method-for-FakeMatch.patch \
-           "
+            file://0001-fix-ipv6-test.patch \
+            "
 
 SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413"
 
#2 lore raw

PATCH 3/5 python3-django: fix hostname length validation in URLvalidator

In reply to Gyorgy Sarvari

This patch is for python3-django_2.2.28

The hostname's length has been incorrectly validated, it was checking an incorrect section of the URL, this made a testcase fail. This backported patch mitigates this issue.

---
 ...d-URLValidator-hostname-length-valid.patch | 30 +++++++++++++++++++
 .../python/python3-django_2.2.28.bb           |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch
meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch new file +30 -0
new file mode 100644
index 0000000000..8cab678a36
@@ -0,0 +1,30 @@
+From ee35cb8dd2f903ddde115ca10186e162ffd8dc62 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Sat, 26 Dec 2020 20:52:44 +0530
+Subject: [PATCH] Fixed #32298 -- Fixed URLValidator hostname length
+ validation.
+
+From: Akshat1Nar <[email protected]>
+
+URLValidator now validates the maximum length of a hostname without
+the userinfo and port.
+
+Upstream-Status: Backport [https://github.com/django/django/commit/b41d38ae26b1da9519a6cd765bc2f2ce7d355007]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ django/core/validators.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/django/core/validators.py b/django/core/validators.py
+index 2dbd3bf..94cc3bf 100644
+--- a/django/core/validators.py
++++ b/django/core/validators.py
+@@ -151,7 +151,7 @@ class URLValidator(RegexValidator):
+         # section 3.1. It's defined to be 255 bytes or less, but this includes
+         # one byte for the length of the name and one byte for the trailing dot
+         # that's used to indicate absolute names in DNS.
+-        if len(urlsplit(value).netloc) > 253:
++        if len(urlsplit(value).hostname) > 253:
+             raise ValidationError(self.message, code=self.code)
+ 
+ 
meta-python/recipes-devtools/python/python3-django_2.2.28.bb +1 -0
index 3dd64a5507..bf7e182aba 100644
@@ -37,6 +37,7 @@ SRC_URI += "file://CVE-2023-31047.patch \
             file://0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch \
             file://0001-implement-group-method-for-FakeMatch.patch \
             file://0001-fix-ipv6-test.patch \
+            file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \
             "
 
 SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413"
#3 lore raw

PATCH 4/5 python3-django: fix ipv6 validation

In reply to Gyorgy Sarvari

This patch is only for python3-django_2.2.28.

The URL validator didn't detect invalid IPv6 addresses, treating them as correct ones, making a testcase fail. (Also, according to the comment, it could also crash in some cases, though I haven't encountered that)

This backported patch mitigates this behavior.

---
 ...d-URLValidator-crash-in-some-edge-ca.patch | 57 +++++++++++++++++++
 .../python/python3-django_2.2.28.bb           |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch
meta-python/recipes-devtools/python/python3-django/0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch new file +57 -0
new file mode 100644
index 0000000000..549e761ec3
@@ -0,0 +1,57 @@
+From 065b10e2757af671f3e64f0c8714e6f2e4eca727 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Wed, 15 Dec 2021 11:55:19 -0300
+Subject: [PATCH] Fixed #33367 -- Fixed URLValidator crash in some edge cases.
+
+From: mendespedro <[email protected]>
+
+Upstream-Status: Backport [https://github.com/django/django/commit/e8b4feddc34ffe5759ec21da8fa027e86e653f1c]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ django/core/validators.py | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/django/core/validators.py b/django/core/validators.py
+index 94cc3bf..03cd9b8 100644
+--- a/django/core/validators.py
++++ b/django/core/validators.py
+@@ -120,15 +120,17 @@ class URLValidator(RegexValidator):
+             raise ValidationError(self.message, code=self.code)
+ 
+         # Then check full URL
++        
++        try:
++            splitted_url = urlsplit(value)
++        except ValueError:
++            raise ValidationError(self.message, code=self.code, params={'value': value})
+         try:
+             super().__call__(value)
+         except ValidationError as e:
+             # Trivial case failed. Try for possible IDN domain
+             if value:
+-                try:
+-                    scheme, netloc, path, query, fragment = urlsplit(value)
+-                except ValueError:  # for example, "Invalid IPv6 URL"
+-                    raise ValidationError(self.message, code=self.code)
++                scheme, netloc, path, query, fragment = splitted_url
+                 try:
+                     netloc = netloc.encode('idna').decode('ascii')  # IDN -> ACE
+                 except UnicodeError:  # invalid domain part
+@@ -139,7 +141,7 @@ class URLValidator(RegexValidator):
+                 raise
+         else:
+             # Now verify IPv6 in the netloc part
+-            host_match = re.search(r'^\[(.+)\](?::\d{2,5})?$', urlsplit(value).netloc)
++            host_match = re.search(r'^\[(.+)\](?::\d{2,5})?$', splitted_url.netloc)
+             if host_match:
+                 potential_ip = host_match.groups()[0]
+                 try:
+@@ -151,7 +153,7 @@ class URLValidator(RegexValidator):
+         # section 3.1. It's defined to be 255 bytes or less, but this includes
+         # one byte for the length of the name and one byte for the trailing dot
+         # that's used to indicate absolute names in DNS.
+-        if len(urlsplit(value).hostname) > 253:
++        if splitted_url.hostname is None or len(splitted_url.hostname) > 253:
+             raise ValidationError(self.message, code=self.code)
+ 
+ 
meta-python/recipes-devtools/python/python3-django_2.2.28.bb +1 -0
index bf7e182aba..0f6f8fc4d0 100644
@@ -38,6 +38,7 @@ SRC_URI += "file://CVE-2023-31047.patch \
             file://0001-implement-group-method-for-FakeMatch.patch \
             file://0001-fix-ipv6-test.patch \
             file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \
+            file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \
             "
 
 SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413"
#4 lore raw

PATCH 5/5 python3-django: fix tests

In reply to Gyorgy Sarvari

These patches are for python3-django_2.2.28

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 since 3.9, 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-inspectdb.tests.InspectDBTestCase.test_custom_.patch: SQLite3's behavior has changed also since the tests were written, making some testcases fail. This backported patch fixes that.

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.

0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch: This backported patch once again adapts a test to an evolved library. tblib's behavior has changed in a way that the tests couldn't pickle the exceptions from the library, and the tests that verify exceptions were failing due to this.

0001-fix-quote-type-in-expected-error-message.patch: This is not a backported patch. Error messages are localized, and a test verifies an error message that contains a quote. The test expects double quotes, but the default locale used with the testimage is using single quotes. Since the test and the expected error message are correct otherwise, just changed this expected quote in the test.

---
 .../0001-Fix-tag_strip-tests.patch            | 37 ++++++++++++
 ...tests.InspectDBTestCase.test_custom_.patch | 45 ++++++++++++++
 ....tests.HTMLEqualTests.test_parsing_e.patch | 32 ++++++++++
 ...esultTest.test_pickle_errors_detecti.patch | 59 +++++++++++++++++++
 ...quote-type-in-expected-error-message.patch | 31 ++++++++++
 .../python/python3-django_2.2.28.bb           |  5 ++
 6 files changed, 209 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Fix-tag_strip-tests.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-django/0001-fix-quote-type-in-expected-error-message.patch
meta-python/recipes-devtools/python/python3-django/0001-Fix-tag_strip-tests.patch new file +37 -0
new file mode 100644
index 0000000000..be5d11e0ba
@@ -0,0 +1,37 @@
+From bd3ffbbacceef7fabd3135ca90eba1397e2b5901 Mon Sep 17 00:00:00 2001
+From: Your Name <[email protected]>
+Date: Tue, 13 Jan 2026 20:07:35 +0000
+Subject: [PATCH] Fix tag_strip tests
+
+Python's htmlparser behavior changed between python versions, and
+the tests expect incorrect result due to this.
+
+This patch is a partial backport, to use only the results that are
+valid for the OE Python version.
+
+Upstream-Status: Backport [https://github.com/django/django/commit/2980627502c84a9fd09272e1349dc574a2ff1fb1]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ tests/utils_tests/test_html.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
+index 86f5562..71757ad 100644
+--- a/tests/utils_tests/test_html.py
++++ b/tests/utils_tests/test_html.py
+@@ -89,10 +89,10 @@ class TestUtilsHtml(SimpleTestCase):
+             ('&gotcha&#;<>', '&gotcha&#;<>'),
+             ('<sc<!-- -->ript>test<<!-- -->/script>', 'ript>test'),
+             ('<script>alert()</script>&h', 'alert()h'),
+-            ('><!' + ('&' * 16000) + 'D', '><!' + ('&' * 16000) + 'D'),
++            ('><!' + ('&' * 16000) + 'D', '>'),
+             ('X<<<<br>br>br>br>X', 'XX'),
+             ("<" * 50 + "a>" * 50, ""),
+-            (">" + "<a" * 500 + "a", ">" + "<a" * 500 + "a"),
++            (">" + "<a" * 500 + "a", ">"),
+             ("<a" * 49 + "a" * 951, "<a" * 49 + "a" * 951),
+             ("<" + "a" * 1_002, "<" + "a" * 1_002),
+         )
+-- 
+2.39.5
+
meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch new file +45 -0

45 lines not on this page · raw message

meta-python/recipes-devtools/python/python3-django/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch new file +32 -0
new file mode 100644
index 0000000000..a84a118bcb
@@ -0,0 +1,32 @@
+From 744927154e6748db08f5232de78ee0d4a8be61a5 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Mon, 21 Jul 2025 15:23:32 -0300
+Subject: [PATCH] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
+ following Python's HTMLParser fixed parsing.
+
+From: Natalia <[email protected]>
+
+Further details about Python changes can be found in:
+https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.
+
+Thank you Clifford Gama for the thorough review!
+
+Upstream-Status: Backport [https://github.com/django/django/commit/e4515dad7a6d953c0bd2414127ba36e1446ff41a]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ tests/test_utils/tests.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
+index a1a113a..d1a1e35 100644
+--- a/tests/test_utils/tests.py
++++ b/tests/test_utils/tests.py
+@@ -736,7 +736,7 @@ class HTMLEqualTests(SimpleTestCase):
+             "('Unexpected end tag `div` (Line 1, Column 6)', (1, 6))"
+         )
+         with self.assertRaisesMessage(AssertionError, error_msg):
+-            self.assertHTMLEqual('< div></ div>', '<div></div>')
++            self.assertHTMLEqual('< div></div>', '<div></div>')
+         with self.assertRaises(HTMLParseError):
+             parse_html('</p>')
+ 
meta-python/recipes-devtools/python/python3-django/0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch new file +59 -0

59 lines not on this page · raw message

meta-python/recipes-devtools/python/python3-django/0001-fix-quote-type-in-expected-error-message.patch new file +31 -0
new file mode 100644
index 0000000000..617d63aa35
@@ -0,0 +1,31 @@
+From 5cae184e0d57dacae25439e533c4e1ef6f6c4cae Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Tue, 13 Jan 2026 23:31:06 +0100
+Subject: [PATCH] fix quote type in expected error message
+
+Instead of double quotes the error is returned with single quotes.
+This is localization dependent, comes from a po file - some locales use
+single quotes, other are translated with double quotes. The default
+locale used with the OE ptest image uses single quotes - adapt the test
+to this.
+
+Upstream-Status: Inappropriate [This is not a nice solution. Hardcoding single quotes is not better than the original]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ tests/forms_tests/field_tests/test_filefield.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/forms_tests/field_tests/test_filefield.py b/tests/forms_tests/field_tests/test_filefield.py
+index ba559ee..3880e11 100644
+--- a/tests/forms_tests/field_tests/test_filefield.py
++++ b/tests/forms_tests/field_tests/test_filefield.py
+@@ -144,7 +144,7 @@ class MultipleFileFieldTest(SimpleTestCase):
+             evil_files[i:] + evil_files[:i]  # Rotate by i.
+             for i in range(len(evil_files))
+         )
+-        msg = "File extension “sh” is not allowed. Allowed extensions are: "
++        msg = "File extension 'sh' is not allowed. Allowed extensions are: "
+         for rotated_evil_files in evil_rotations:
+             with self.assertRaisesMessage(ValidationError, msg):
+                 f.clean(rotated_evil_files)
meta-python/recipes-devtools/python/python3-django_2.2.28.bb +5 -0
index 0f6f8fc4d0..dedb2498cb 100644
@@ -39,6 +39,11 @@ SRC_URI += "file://CVE-2023-31047.patch \
             file://0001-fix-ipv6-test.patch \
             file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \
             file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \
+            file://0001-Fix-tag_strip-tests.patch \
+            file://0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch \
+            file://0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch \
+            file://0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch \
+            file://0001-fix-quote-type-in-expected-error-message.patch \
             "
 
 SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413"