mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Ensure bulk_create returns the right value if the argument is an empty list.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -23,6 +23,10 @@ class BulkCreateTests(TestCase):
|
||||
"United States of America", "The Netherlands", "Germany", "Czech Republic"
|
||||
], attrgetter("name"))
|
||||
|
||||
created = Country.objects.bulk_create([])
|
||||
self.assertEqual(created, [])
|
||||
self.assertEqual(Country.objects.count(), 4)
|
||||
|
||||
@skipUnlessDBFeature("has_bulk_insert")
|
||||
def test_efficiency(self):
|
||||
with self.assertNumQueries(1):
|
||||
|
||||
Reference in New Issue
Block a user