Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2990e6f

Browse files
committed
[4.0.x] Fixed inspectdb.tests.InspectDBTestCase.test_custom_fields() on SQLite 3.37+.
Use FlexibleFieldLookupDict which is case-insensitive mapping becauseSQLite 3.37+ returns some data type names upper-cased e.g. TEXT.Backport of974e3b8 from main.
1 parent8fe7bdc commit2990e6f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎tests/inspectdb/tests.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,18 +387,17 @@ def test_custom_fields(self):
387387
Introspection of columns with a custom field (#21090)
388388
"""
389389
out=StringIO()
390-
orig_data_types_reverse=connection.introspection.data_types_reverse
391-
try:
392-
connection.introspection.data_types_reverse={
390+
withmock.patch(
391+
"django.db.connection.introspection.data_types_reverse.base_data_types_reverse",
392+
{
393393
"text":"myfields.TextField",
394394
"bigint":"BigIntegerField",
395-
}
395+
},
396+
):
396397
call_command("inspectdb","inspectdb_columntypes",stdout=out)
397398
output=out.getvalue()
398399
self.assertIn("text_field = myfields.TextField()",output)
399400
self.assertIn("big_int_field = models.BigIntegerField()",output)
400-
finally:
401-
connection.introspection.data_types_reverse=orig_data_types_reverse
402401

403402
deftest_introspection_errors(self):
404403
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp