-
-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The changes in #438 prevent generic foreign keys passed to baker.prepare from being filled correctly. The _handle_generic_foreign_keys method is never called since _commit is False. The following test case added to the class TestFillingGenericForeignKeyField demonstrates the issue:
def test_filling_generic_foreign_key_field_with_prepare(self):
from django.contrib.contenttypes.models import ContentType
profile = baker.make(models.Profile)
dummy = baker.prepare(
models.DummyGenericForeignKeyModel, content_object=profile
)
expected_content_type = ContentType.objects.get_for_model(models.Profile)
assert dummy.content_object == profile
assert dummy.content_type == expected_content_type
assert dummy.object_id == profile.pkamureki
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working