mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-16 00:23:10 +00:00
Adds a comment for get_or_create test.
This commit is contained in:
parent
baafe6246d
commit
9e576f4d40
1 changed files with 4 additions and 0 deletions
|
|
@ -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, [])
|
||||
|
|
|
|||
Loading…
Reference in a new issue