mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #14700 -- ensure that a raw query is only executed once per iteration.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5475da1c32
commit
d68598e022
2 changed files with 11 additions and 2 deletions
|
@ -217,3 +217,8 @@ class RawQueryTests(TestCase):
|
|||
self.assertEqual(
|
||||
[o.pk for o in FriendlyAuthor.objects.raw(query)], [f.pk]
|
||||
)
|
||||
|
||||
def test_query_count(self):
|
||||
self.assertNumQueries(1,
|
||||
list, Author.objects.raw("SELECT * FROM raw_query_author")
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue