diff options
Diffstat (limited to 'tests/bulk_create/tests.py')
| -rw-r--r-- | tests/bulk_create/tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py index ce069504d0..f881a1dba0 100644 --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -10,8 +10,8 @@ from django.test import ( ) from .models import ( - Country, Pizzeria, ProxyCountry, ProxyMultiCountry, ProxyMultiProxyCountry, - ProxyProxyCountry, Restaurant, State, TwoFields, + Country, NoFields, Pizzeria, ProxyCountry, ProxyMultiCountry, + ProxyMultiProxyCountry, ProxyProxyCountry, Restaurant, State, TwoFields, ) @@ -177,6 +177,10 @@ class BulkCreateTests(TestCase): TwoFields.objects.bulk_create(objs, len(objs)) self.assertEqual(TwoFields.objects.count(), len(objs)) + def test_empty_model(self): + NoFields.objects.bulk_create([NoFields() for i in range(2)]) + self.assertEqual(NoFields.objects.count(), 2) + @skipUnlessDBFeature('has_bulk_insert') def test_explicit_batch_size_efficiency(self): objs = [TwoFields(f1=i, f2=i) for i in range(0, 100)] |
