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:
Alex Gaynor 2010-12-03 20:25:59 +00:00
parent 5475da1c32
commit d68598e022
2 changed files with 11 additions and 2 deletions

View file

@ -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")
)