Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce: Cannot call baker.make() with ForeignKey default=pk, only actual model instance #137

Closed

Conversation

cb109
Copy link
Contributor

@cb109 cb109 commented Dec 9, 2020

See #136

I tried to fix the problem by passing a model instance as the default within baker.generate_value() instead of passing a pk/id/to_field value, and that even passed all tests, but using this version model_bakery within our own test suite actually broke many, many tests, so I reverted that for now.

For now this simply reproduces the problem as a starting point for a fix. To reproduce run:

$ pytest tests/ -k test_filling_foreignkey_with_default_id

@cb109 cb109 changed the title Fix: Cannot call baker.make() with ForeignKey default=pk, only actual model instance Reproduce: Cannot call baker.make() with ForeignKey default=pk, only actual model instance Dec 9, 2020
@berinhard
Copy link
Member

Fixed via #164

@berinhard berinhard closed this Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants