diff options
| author | guro-Ishiguro <guro120411@gmail.com> | 2025-12-23 00:30:05 +0900 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-12-22 20:33:39 -0500 |
| commit | 847b2badccbd87fc3e657725eb316b092265912d (patch) | |
| tree | 3579dc4cfe99b60f06d9a47f36c0826dd13087a6 /tests | |
| parent | f31445f2e7e1091ab4de81b9c994052fc6842e22 (diff) | |
[6.0.x] Fixed #36818 -- Ensured SQLite connection before accessing max_query_params.
Regression in 358fd21c47cdf7bda520ce73c5cfd82bba57827b.
Backport of 84bae9c22a8ae7663c56cce5e0c611ea7c17fce1 from main.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/backends/sqlite/test_features.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/backends/sqlite/test_features.py b/tests/backends/sqlite/test_features.py index 95e060fbcc..45c3ec9f2c 100644 --- a/tests/backends/sqlite/test_features.py +++ b/tests/backends/sqlite/test_features.py @@ -1,3 +1,4 @@ +import copy import sqlite3 from unittest import mock, skipUnless @@ -29,3 +30,13 @@ class FeaturesTests(TestCase): finally: connection.connection.setlimit(limit_name, current_limit) self.assertEqual(connection.features.max_query_params, current_limit) + + def test_max_query_params_without_established_connection(self): + new_connection = connection.copy() + new_connection.settings_dict = copy.deepcopy(connection.settings_dict) + self.assertIsNone(new_connection.connection) + try: + result = new_connection.features.max_query_params + self.assertIsInstance(result, int) + finally: + new_connection._close() |
