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

Problems with content types and permissions in fixtures: "DeserializationError: ContentType matching query does not exist." #1

Open
blueyed opened this issue Jan 22, 2015 · 3 comments

Comments

@blueyed
Copy link

blueyed commented Jan 22, 2015

I am having the issue that the content types are not available yet when the migration is run.

I've found out that they get created in a post-migration hook, which apparently gets not invoked between each migration step?!

The fix for this seemed easy then, but then it failed because the auth data was not available yet, and that was not so trivial to work around.

I'll provide a PR with my changed, but hopefully I am just missing something.

Do you use ContentType and permissions in your initial data dumps?

I could also imagine that using pytest instead of the Django testrunner might be causing this.

@blueyed
Copy link
Author

blueyed commented Jan 22, 2015

I've found a way to get it working, by using the post_migrate hook ourselves.
Additionally, it's required to reset DB sequences for PostgreSQL.

@alexhayes
Copy link
Owner

For a bit of background we are using MySQL and django-nose (which uses the Django testrunner), we also don't have any ContentType or permissions in fixtures, we're letting Django create those or in the case of permissions create them manually in setUp().

Based on your most recent comment does that mean your PR is no longer required?

@blueyed
Copy link
Author

blueyed commented Jan 23, 2015

The PR is still required, but took a different approach.

Not using contenttypes or auth in the fixtures means that the bug(s) are not triggered.
There might be other (internal) models affected, but these are the ones I'm using.

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

No branches or pull requests

2 participants