From e0d68084a0a89ada1ff030d03d9f9eb51dcfd159 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 3 Dec 2010 20:26:57 +0000 Subject: [1.2.X] Fixed #14700 -- ensure that a raw query is only executed once per iteration. Backport of [14785]. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14786 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/raw_query/tests.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/raw_query/tests.py b/tests/modeltests/raw_query/tests.py index a0325eff97..e7cadfae8c 100644 --- a/tests/modeltests/raw_query/tests.py +++ b/tests/modeltests/raw_query/tests.py @@ -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") + ) -- cgit v1.3