When I run django tests I get the error:
IntegrityError: Problem installing fixture ... ContentType matching query does not exist.: (auth.group:pk=2) field_value was '[u'add_corsmodel', u'corsheaders', u'corsmodel']'
I get the fixtures by doing
python manage.py dumpdata --natural-foreign --exclude=contenttypes --exclude=auth.Permission
How can I solve this? should I exclude some other table?
well I tried to do one simple thing to add permissions. I've created a .json file and put in data.
[
{
"model": "auth.group",
"fields": {
"name": "foo",
"permissions": [
29,45,46,47,48 //permission ID's created in auth.group
]
}
},
{
"model": "auth.group",
"fields": {
"name": "new_grp",
"permissions": [
29,45,46,47,48
]
}
}
]
this is my initial permissions that I want to include and then
manage.py loaddata <myJsonFIle>
i think in your case it is not able to find the rows or columns in the table that's why it shows IntegrityError
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With