diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-18 20:56:10 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-18 20:57:08 +0100 |
| commit | ed6db5354294b5492423027d60a60b787b6cdc42 (patch) | |
| tree | d759db55e7d6f29201e01da2c98c1baa16abee66 /tests/backends/sqlite | |
| parent | fbacaa58ffc5a62456ee68b90efa13957f761ce4 (diff) | |
Fixed isolation of FeaturesTests.test_supports_json_field_operational_error().
Diffstat (limited to 'tests/backends/sqlite')
| -rw-r--r-- | tests/backends/sqlite/test_features.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/backends/sqlite/test_features.py b/tests/backends/sqlite/test_features.py index 50ccbbd3cc..5bc891f5ee 100644 --- a/tests/backends/sqlite/test_features.py +++ b/tests/backends/sqlite/test_features.py @@ -10,8 +10,9 @@ class FeaturesTests(TestCase): if hasattr(connection.features, "supports_json_field"): del connection.features.supports_json_field msg = "unable to open database file" - with mock.patch( - "django.db.backends.base.base.BaseDatabaseWrapper.cursor", + with mock.patch.object( + connection, + "cursor", side_effect=OperationalError(msg), ): with self.assertRaisesMessage(OperationalError, msg): |
