diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-15 09:29:13 +0100 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-17 13:45:33 +0100 |
| commit | 62927185fe7591c9a2596647f36f19cc6a4607ef (patch) | |
| tree | d624750b588c17c5901759acdd1af0226bc4e85d /meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch | |
| parent | 4b5afd0ea72ba411c972a2da903eb2553e61e495 (diff) | |
| download | meta-openembedded-62927185fe7591c9a2596647f36f19cc6a4607ef.tar.gz | |
python3-django: (v2.2.28) fix tests
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.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django/0001-Fixed-inspectdb.tests.InspectDBTestCase.test_custom_.patch | 45 |
1 files changed, 45 insertions, 0 deletions
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 | """ | ||
