summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGagaro <gagaro42@gmail.com>2022-03-22 09:11:46 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-03-22 09:45:59 +0100
commit7325d291524827806feed271a077ea23e2b1b21f (patch)
treeac0e84fdb52a27c7795f88f70ef8fc9f71ebccbb /tests
parentf77216bd1a777e219aeada964c5af134f4112111 (diff)
Refs #30581 -- Fixed DatabaseFeatures.bare_select_suffix on MySQL < 8 and MariaDB < 10.4.
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 28e00a04ca..85b0e55cb0 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -548,6 +548,12 @@ class BackendTestCase(TransactionTestCase):
)
self.assertEqual(tuple(kwargs["extra"].values()), params[1:])
+ def test_queries_bare_where(self):
+ sql = f"SELECT 1{connection.features.bare_select_suffix} WHERE 1=1"
+ with connection.cursor() as cursor:
+ cursor.execute(sql)
+ self.assertEqual(cursor.fetchone(), (1,))
+
def test_timezone_none_use_tz_false(self):
connection.ensure_connection()
with self.settings(TIME_ZONE=None, USE_TZ=False):