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

Test and update fixture loading, in MySQL and other engines #314

Open
jwhitlock opened this issue Aug 19, 2020 · 0 comments
Open

Test and update fixture loading, in MySQL and other engines #314

jwhitlock opened this issue Aug 19, 2020 · 0 comments

Comments

@jwhitlock
Copy link
Contributor

_foreign_key_ignoring_handle in django_nose.runner has this comment:

def _foreign_key_ignoring_handle(self, *fixture_labels, **options):
"""Wrap the the stock loaddata to ignore foreign key checks.
This allows loading circular references from fixtures, and is
monkeypatched into place in setup_databases().
"""

This was brought over in #50, a large refactor to merge in the test-utils project.

This code presented problems when fixtures were loaded with Django 2.0, which were tracked down to assumptions about the commit argument, removed in Django 1.5 (see #307 (comment)). The code was fixed in #308, and @dlareau suggested the code should be revisited (see #307 (comment)).

It is possible that modern Django has other methods for loading fixtures while avoiding circular imports, and _foreign_key_ignoring_handle should be retired. A good first step would be to add a django-nose test that exercises loading fixtures, ideally with a circular reference.

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

1 participant