Skip to content

model_bakery/baker.py:802: AttributeErrorΒ #575

@paulredman-

Description

@paulredman-

First, thanks for this great module. We use it to create the majority of test data for over 10,000 tests.

Describe the issue
We get the following assertion running out tests:
E AttributeError: 'ManyToOneRel' object has no attribute 'has_default'

To Reproduce
None provided, but I am happy to assist if it is not easily reproducible.

Expected behavior
The data should be created successfully.

I have been using a patch - see https://github.com/paulredman-/model_bakery_1.20.5_patched - which has worked impeccably, but I would love to get back on the mainline.

Versions

  • Python: 3.10
  • Django 5.2.10
  • Model Bakery [e.g. 1.20.5] but also tested with 1.23.2
  • running on Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions