diff options
Diffstat (limited to 'meta-python/recipes-devtools/python')
6 files changed, 209 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fix-tag_strip-tests.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fix-tag_strip-tests.patch new file mode 100644 index 0000000000..be5d11e0ba --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fix-tag_strip-tests.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | From bd3ffbbacceef7fabd3135ca90eba1397e2b5901 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Your Name <you@example.com> | ||
| 3 | Date: Tue, 13 Jan 2026 20:07:35 +0000 | ||
| 4 | Subject: [PATCH] Fix tag_strip tests | ||
| 5 | |||
| 6 | Python's htmlparser behavior changed between python versions, and | ||
| 7 | the tests expect incorrect result due to this. | ||
| 8 | |||
| 9 | This patch is a partial backport, to use only the results that are | ||
| 10 | valid for the OE Python version. | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/django/django/commit/2980627502c84a9fd09272e1349dc574a2ff1fb1] | ||
| 13 | Signed-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 | |||
| 18 | diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py | ||
| 19 | index 86f5562..71757ad 100644 | ||
| 20 | --- a/tests/utils_tests/test_html.py | ||
| 21 | +++ b/tests/utils_tests/test_html.py | ||
| 22 | @@ -89,10 +89,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 | -- | ||
| 36 | 2.39.5 | ||
| 37 | |||
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch new file mode 100644 index 0000000000..e84fc303bb --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 1d3a464a2e7db2eaa6e63fa806cea45bff3365b2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Thu, 9 Dec 2021 20:24:38 +0100 | ||
| 4 | Subject: [PATCH] Fixed inspectdb.tests.InspectDBTestCase.test_custom_fields() | ||
| 5 | on SQLite 3.37+. | ||
| 6 | |||
| 7 | From: Mariusz Felisiak <felisiak.mariusz@gmail.com> | ||
| 8 | |||
| 9 | Use FlexibleFieldLookupDict which is case-insensitive mapping because | ||
| 10 | SQLite 3.37+ returns some data type names upper-cased e.g. TEXT. | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/django/django/commit/974e3b8750fe96c16c9c0b115a72ee4a2171df34] | ||
| 13 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 14 | --- | ||
| 15 | tests/inspectdb/tests.py | 11 +++++------ | ||
| 16 | 1 file changed, 5 insertions(+), 6 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py | ||
| 19 | index bb5e457..a2519cf 100644 | ||
| 20 | --- a/tests/inspectdb/tests.py | ||
| 21 | +++ b/tests/inspectdb/tests.py | ||
| 22 | @@ -256,18 +256,17 @@ class InspectDBTestCase(TestCase): | ||
| 23 | Introspection of columns with a custom field (#21090) | ||
| 24 | """ | ||
| 25 | out = StringIO() | ||
| 26 | - orig_data_types_reverse = connection.introspection.data_types_reverse | ||
| 27 | - try: | ||
| 28 | - connection.introspection.data_types_reverse = { | ||
| 29 | + with mock.patch( | ||
| 30 | + 'django.db.connection.introspection.data_types_reverse.base_data_types_reverse', | ||
| 31 | + { | ||
| 32 | 'text': 'myfields.TextField', | ||
| 33 | 'bigint': 'BigIntegerField', | ||
| 34 | - } | ||
| 35 | + }, | ||
| 36 | + ): | ||
| 37 | call_command('inspectdb', 'inspectdb_columntypes', stdout=out) | ||
| 38 | output = out.getvalue() | ||
| 39 | self.assertIn("text_field = myfields.TextField()", output) | ||
| 40 | self.assertIn("big_int_field = models.BigIntegerField()", output) | ||
| 41 | - finally: | ||
| 42 | - connection.introspection.data_types_reverse = orig_data_types_reverse | ||
| 43 | |||
| 44 | def test_introspection_errors(self): | ||
| 45 | """ | ||
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch new file mode 100644 index 0000000000..a84a118bcb --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 744927154e6748db08f5232de78ee0d4a8be61a5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Mon, 21 Jul 2025 15:23:32 -0300 | ||
| 4 | Subject: [PATCH] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors | ||
| 5 | following Python's HTMLParser fixed parsing. | ||
| 6 | |||
| 7 | From: Natalia <124304+nessita@users.noreply.github.com> | ||
| 8 | |||
| 9 | Further details about Python changes can be found in: | ||
| 10 | https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3. | ||
| 11 | |||
| 12 | Thank you Clifford Gama for the thorough review! | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://github.com/django/django/commit/e4515dad7a6d953c0bd2414127ba36e1446ff41a] | ||
| 15 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 16 | --- | ||
| 17 | tests/test_utils/tests.py | 2 +- | ||
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py | ||
| 21 | index a1a113a..d1a1e35 100644 | ||
| 22 | --- a/tests/test_utils/tests.py | ||
| 23 | +++ b/tests/test_utils/tests.py | ||
| 24 | @@ -736,7 +736,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/0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch b/meta-python/recipes-devtools/python/python3-django/0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch new file mode 100644 index 0000000000..f515494254 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | From 80d06be0a5dc82d8cf8dd8105b6734c188743fae Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Tue, 21 Oct 2025 21:11:44 +0200 | ||
| 4 | Subject: [PATCH] Made RemoteTestResultTest.test_pickle_errors_detection() | ||
| 5 | compatible with tblib 3.2+. | ||
| 6 | |||
| 7 | From: Mariusz Felisiak <felisiak.mariusz@gmail.com> | ||
| 8 | |||
| 9 | tblib 3.2+ makes exception subclasses with __init__() and the default | ||
| 10 | __reduce__() picklable. This broke the test for | ||
| 11 | RemoteTestResult._confirm_picklable(), which expects a specific | ||
| 12 | exception to fail unpickling. | ||
| 13 | |||
| 14 | https://github.com/ionelmc/python-tblib/blob/master/CHANGELOG.rst#320-2025-10-21 | ||
| 15 | |||
| 16 | This fix defines ExceptionThatFailsUnpickling.__reduce__() in a way | ||
| 17 | that pickle.dumps(obj) succeeds, but pickle.loads(pickle.dumps(obj)) | ||
| 18 | raises TypeError. | ||
| 19 | |||
| 20 | Refs #27301. This preserves the intent of the regression test from | ||
| 21 | 52188a5ca6bafea0a66f17baacb315d61c7b99cd without skipping it. | ||
| 22 | |||
| 23 | Upstream-Status: Backport [https://github.com/django/django/commit/548209e620b3ca34396a360453f07c8dbb8aa6c7] | ||
| 24 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 25 | --- | ||
| 26 | tests/test_runner/test_parallel.py | 8 ++++++++ | ||
| 27 | 1 file changed, 8 insertions(+) | ||
| 28 | |||
| 29 | diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py | ||
| 30 | index c1a89bd..7c72216 100644 | ||
| 31 | --- a/tests/test_runner/test_parallel.py | ||
| 32 | +++ b/tests/test_runner/test_parallel.py | ||
| 33 | @@ -1,3 +1,4 @@ | ||
| 34 | +import pickle | ||
| 35 | import unittest | ||
| 36 | |||
| 37 | from django.test import SimpleTestCase | ||
| 38 | @@ -18,6 +19,12 @@ class ExceptionThatFailsUnpickling(Exception): | ||
| 39 | def __init__(self, arg): | ||
| 40 | super().__init__() | ||
| 41 | |||
| 42 | + def __reduce__(self): | ||
| 43 | + # tblib 3.2+ makes exception subclasses picklable by default. | ||
| 44 | + # Return (cls, ()) so the constructor fails on unpickle, preserving | ||
| 45 | + # the needed behavior for test_pickle_errors_detection. | ||
| 46 | + return (self.__class__, ()) | ||
| 47 | + | ||
| 48 | |||
| 49 | class ParallelTestRunnerTest(SimpleTestCase): | ||
| 50 | """ | ||
| 51 | @@ -59,6 +66,8 @@ class RemoteTestResultTest(SimpleTestCase): | ||
| 52 | result = RemoteTestResult() | ||
| 53 | result._confirm_picklable(picklable_error) | ||
| 54 | |||
| 55 | + # The exception can be pickled but not unpickled. | ||
| 56 | + pickle.dumps(not_unpicklable_error) | ||
| 57 | msg = '__init__() missing 1 required positional argument' | ||
| 58 | with self.assertRaisesMessage(TypeError, msg): | ||
| 59 | result._confirm_picklable(not_unpicklable_error) | ||
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-fix-quote-type-in-expected-error-message.patch b/meta-python/recipes-devtools/python/python3-django/0001-fix-quote-type-in-expected-error-message.patch new file mode 100644 index 0000000000..617d63aa35 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-fix-quote-type-in-expected-error-message.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 5cae184e0d57dacae25439e533c4e1ef6f6c4cae Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Tue, 13 Jan 2026 23:31:06 +0100 | ||
| 4 | Subject: [PATCH] fix quote type in expected error message | ||
| 5 | |||
| 6 | Instead of double quotes the error is returned with single quotes. | ||
| 7 | This is localization dependent, comes from a po file - some locales use | ||
| 8 | single quotes, other are translated with double quotes. The default | ||
| 9 | locale used with the OE ptest image uses single quotes - adapt the test | ||
| 10 | to this. | ||
| 11 | |||
| 12 | Upstream-Status: Inappropriate [This is not a nice solution. Hardcoding single quotes is not better than the original] | ||
| 13 | |||
| 14 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 15 | --- | ||
| 16 | tests/forms_tests/field_tests/test_filefield.py | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/tests/forms_tests/field_tests/test_filefield.py b/tests/forms_tests/field_tests/test_filefield.py | ||
| 20 | index ba559ee..3880e11 100644 | ||
| 21 | --- a/tests/forms_tests/field_tests/test_filefield.py | ||
| 22 | +++ b/tests/forms_tests/field_tests/test_filefield.py | ||
| 23 | @@ -144,7 +144,7 @@ class MultipleFileFieldTest(SimpleTestCase): | ||
| 24 | evil_files[i:] + evil_files[:i] # Rotate by i. | ||
| 25 | for i in range(len(evil_files)) | ||
| 26 | ) | ||
| 27 | - msg = "File extension “sh” is not allowed. Allowed extensions are: " | ||
| 28 | + msg = "File extension 'sh' is not allowed. Allowed extensions are: " | ||
| 29 | for rotated_evil_files in evil_rotations: | ||
| 30 | with self.assertRaisesMessage(ValidationError, msg): | ||
| 31 | f.clean(rotated_evil_files) | ||
diff --git a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb index 0f6f8fc4d0..dedb2498cb 100644 --- a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb +++ b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb | |||
| @@ -39,6 +39,11 @@ SRC_URI += "file://CVE-2023-31047.patch \ | |||
| 39 | file://0001-fix-ipv6-test.patch \ | 39 | file://0001-fix-ipv6-test.patch \ |
| 40 | file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \ | 40 | file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \ |
| 41 | file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \ | 41 | file://0001-Fixed-33367-Fixed-URLValidator-crash-in-some-edge-ca.patch \ |
| 42 | file://0001-Fix-tag_strip-tests.patch \ | ||
| 43 | file://0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch \ | ||
| 44 | file://0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch \ | ||
| 45 | file://0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch \ | ||
| 46 | file://0001-fix-quote-type-in-expected-error-message.patch \ | ||
| 42 | " | 47 | " |
| 43 | 48 | ||
| 44 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" | 49 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" |
