Ticket #15155: fix-15155.patch
File fix-15155.patch, 1.4 KB (added by , 14 years ago) |
---|
-
django/db/backends/sqlite3/base.py
186 186 if self.settings_dict['NAME'] != ":memory:": 187 187 BaseDatabaseWrapper.close(self) 188 188 189 FORMAT_QMARK_REGEX = re.compile(r'(? ![^%])%s')189 FORMAT_QMARK_REGEX = re.compile(r'(?<!%)%s') 190 190 191 191 class SQLiteCursorWrapper(Database.Cursor): 192 192 """ -
tests/regressiontests/backends/tests.py
206 206 self.assertEqual(cursor.fetchone(), (u'Clark', u'Kent')) 207 207 self.assertEqual(list(cursor.fetchmany(2)), [(u'Jane', u'Doe'), (u'John', u'Doe')]) 208 208 self.assertEqual(list(cursor.fetchall()), [(u'Mary', u'Agnelline'), (u'Peter', u'Parker')]) 209 210 if settings.DATABASES[DEFAULT_DB_ALIAS]["ENGINE"] == "django.db.backends.sqlite3": 211 class EscapingChecks(unittest.TestCase): 212 213 def test_parameter_escaping(self): 214 # ticket #15155 215 cursor = connection.cursor() 216 response = cursor.execute("select strftime('%%s', date('now'))").fetchall()[0][0] 217 self.assertNotEqual(response, None)