Adds a comment for get_or_create test.

This commit is contained in:
Bertrand Bordage 2014-09-29 10:17:48 +02:00
parent baafe6246d
commit 9e576f4d40

View file

@ -498,6 +498,10 @@ class WriteTestCase(TestCase):
self.assertListEqual(data3, [t1, t2, t3])
def test_get_or_create(self):
"""
Tests if the ``SELECT`` query of a ``QuerySet.get_or_create``
is cached, but not the ``INSERT`` one.
"""
with self.assertNumQueries(1):
data1 = list(Test.objects.all())
self.assertListEqual(data1, [])