Ticket #17158: 17158-testcase.patch

File 17158-testcase.patch, 944 bytes (added by Aymeric Augustin, 13 years ago)
  • tests/regressiontests/backends/tests.py

     
    121121        self.assertTrue("= 'special:\\\\\\\"\\':' " in sql)
    122122        self.assertTrue("= 12 " in sql)
    123123
     124
     125    @unittest.skipUnless(connection.vendor == 'sqlite',
     126                         "This test is specific to SQLite.")
     127    def test_interpolation(self):
     128        # Regression for #17158
     129        # This shouldn't raise an exception
     130        query = "SELECT strftime('%Y', 'now');"
     131        connection.cursor().execute(query)
     132        self.assertEqual(connection.queries[-1]['sql'], query)
     133
    124134class ParameterHandlingTest(TestCase):
    125135    def test_bad_parameter_count(self):
    126136        "An executemany call with too many/not enough parameters will raise an exception (Refs #12612)"
Back to Top