diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index cf4242d62c..c6d28ab135 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -127,28 +127,12 @@ class DateQuotingTest(TestCase): class LastExecutedQueryTest(TestCase): - # There are no escaping tests for the sqlite backend because it does not - # implement paramater escaping. See #14091. - - @unittest.skipUnless(connection.vendor in ('oracle', 'postgresql'), - "These backends use the standard parameter escaping rules") @override_settings(DEBUG=True) - def test_parameter_escaping(self): - # check that both numbers and string are properly quoted - list(models.Tag.objects.filter(name="special:\\\"':", object_id=12)) - sql = connection.queries[-1]['sql'] - self.assertTrue("= 'special:\\\"'':' " in sql) - self.assertTrue("= 12 " in sql) - - @unittest.skipUnless(connection.vendor == 'mysql', - "MySQL uses backslashes to escape parameters.") - @override_settings(DEBUG=True) - def test_parameter_escaping(self): - list(models.Tag.objects.filter(name="special:\\\"':", object_id=12)) - sql = connection.queries[-1]['sql'] - # only this line is different from the test above - self.assertTrue("= 'special:\\\\\\\"\\':' " in sql) - self.assertTrue("= 12 " in sql) + def test_debug_sql(self): + list(models.Tag.objects.filter(name="test")) + sql = connection.queries[-1]['sql'].lower() + self.assertTrue(sql.startswith("select")) + self.assertIn(models.Tag._meta.db_table, sql) def test_query_encoding(self): """