mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #21603 -- Fixed complex RawQuerySets queries on some versions of SQLite.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user