You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-Up to #385, which was fixed in #486. When specifying values for a M2M field that has a reverse_name, baker currently tries to create an instance of the through-model using the related name when _bulk_create=True is passed.
Add this test case to TestCreateM2MWhenBulkCreate. Note that it is very similar to test_create, just the model used is switched from Classroom to Store, since Store.customers specifies a related_name.
___TestCreateM2MWhenBulkCreate.test_create_with_field_with_related_name ___
tests/test_baker.py:1090: in test_create_with_field_with_related_name
baker.make(
model_bakery/baker.py:131: in make
return bulk_create(baker, _quantity, _save_kwargs=_save_kwargs, **attrs)
model_bakery/baker.py:857: in bulk_create
[
model_bakery/baker.py:858: in <listcomp>
through_model(
../../.local/lib/python3.10/site-packages/django/db/models/base.py:567: in __init__
raise TypeError(
E TypeError: Store_customers() got unexpected keyword arguments: 'favorite_stores'
Follow-Up to #385, which was fixed in #486. When specifying values for a M2M field that has a
reverse_name
, baker currently tries to create an instance of the through-model using the related name when_bulk_create=True
is passed.Add this test case to
TestCreateM2MWhenBulkCreate
. Note that it is very similar totest_create
, just the model used is switched fromClassroom
toStore
, sinceStore.customers
specifies arelated_name
.The test fails with this error:
Versions
The text was updated successfully, but these errors were encountered: