summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-12-03 20:25:59 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-12-03 20:25:59 +0000
commitd68598e0220908ca82cf98ba769e618404c010c8 (patch)
tree3f41977916224508f5961eced70e40a31ad5f5ec /tests
parent5475da1c32efacab3d740bc599f19f2f33be6d2c (diff)
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
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")
+ )