mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 03:32:55 +03:00
Simplify test case for bulk_create
This commit is contained in:
parent
b97a7f3c23
commit
6736b3b32d
@ -16,27 +16,6 @@ class LocalizedBulkTestCase(TestCase):
|
||||
|
||||
@staticmethod
|
||||
def test_localized_bulk_insert():
|
||||
"""Tests that bulk inserts work properly when using
|
||||
a :see:LocalizedField in the model."""
|
||||
|
||||
model = get_fake_model(
|
||||
'BulkInsertModel',
|
||||
{
|
||||
'name': LocalizedField(),
|
||||
'score': models.IntegerField()
|
||||
}
|
||||
)
|
||||
|
||||
objects = model.objects.bulk_create([
|
||||
model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1),
|
||||
model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2),
|
||||
model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3)
|
||||
])
|
||||
|
||||
assert model.objects.all().count() == 3
|
||||
|
||||
@staticmethod
|
||||
def test_localized_slug_bulk_insert():
|
||||
"""Tests whether bulk inserts work properly when using
|
||||
a :see:LocalizedUniqueSlugField in the model."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user