summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-12-03 20:26:57 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-12-03 20:26:57 +0000
commite0d68084a0a89ada1ff030d03d9f9eb51dcfd159 (patch)
treea357b358549827e3db292f81e7d72766a2b84f1d /tests
parent99b5526c19841abb398364947d04460f743dc216 (diff)
[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
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/raw_query/tests.py5
1 files changed, 5 insertions, 0 deletions
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")
+ )