Fixed #21603 -- Fixed complex RawQuerySets queries on some versions of SQLite.

This commit is contained in:
Alex Hill 2013-12-13 14:04:28 +08:00 committed by Tim Graham
parent edcc75e5ac
commit 938da36cb1
4 changed files with 30 additions and 1 deletions

View file

@ -239,3 +239,9 @@ class RawQueryTests(TestCase):
def test_query_count(self):
self.assertNumQueries(1, list, Author.objects.raw("SELECT * FROM raw_query_author"))
def test_subquery_in_raw_sql(self):
try:
list(Book.objects.raw('SELECT "id" FROM (SELECT * FROM raw_query_book WHERE paperback) sq'))
except InvalidQuery:
self.fail("Using a subquery in a RawQuerySet raised InvalidQuery")