Comments (2)
Hello,
I'm facing the same issue.
I sense that gen_m2m
should only use MAX_MANY_QUANTITY
in the context of a make_m2m
, not when explicitly specifying values.
@berinhard what do you think ? would you accept a contribution in that way ?
from model_bakery.
Hi! Sorry for the extreme late reply on this issue, but the lib renaming was a high priority for us and all other issues were on hold.
Model bakery do not handle constraints because this would hide complexity from the test code. We prefer to be explicit rather than implicit for this type of error. Instead of forcing a groups__name
value, I suggest you to use the following and more explicit test code:
group = baker.make(Group, name='foo')
user = baker.make(User, groups=[group])
from model_bakery.
Related Issues (20)
- Feature request: Support setting random seed for repeatable test runs HOT 2
- `make()` with `_bulk_create=True` does not create M2M-entries that are specified using the reverse/related name.
- Using `related` with FK relation creates a duplicate entity HOT 1
- FR: m2m through model with extra fields HOT 2
- RangeFields are broken on Django 4.2
- String generation fails on Django 4.2 for CharField(max_length=None)
- utils.seq does not start from 0
- `GenericForeignKey` not accounted for in `baker._skip_field()` HOT 5
- TypeError: <class 'jsonfield.fields.JSONField'> is not supported by baker. HOT 4
- How do I deal with complex relationships?
- Overwriting one attribute deletes foreign key data in v1.14 HOT 11
- Use existing object by foreign_key relationship
- Installation documentation references incorrect package name HOT 2
- `_bulk_create` without `_quantity` will be ignored
- auto_now_add=True Fields do not match baker.make return
- Using other fields to generate data
- Reverse one-to-one relation not persisting in database
- Feature request: Ability to exclude fields in _fill_optional
- m2m, through fields and _bulk_create seems broken
- Django 5 db_default field parameter ignored when creating recipies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from model_bakery.