-
Notifications
You must be signed in to change notification settings - Fork 348
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
Add support for testing unmanaged models (updated) #310
Conversation
pytest_django/plugin.py
Outdated
with connection.schema_editor() as schema: | ||
schema.deferred_sql = [] | ||
for model_class in models: | ||
if not hasattr(model, '_meta'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be model_class ?
What needs to be done to make this a reality? Does anyone want help on this? |
@halfnibble |
The new PR has problems with mysql; can anyone help? @halfnibble? |
Yes. I think I will take a look at this. We use MySQL in production, so supporting it is important! |
working code from timb07@176ac9f see pytest-dev#270
wordpress unmanaged models needs django_use_model marker see pytest-dev/pytest-django#310
wordpress unmanaged models needs django_use_model marker see pytest-dev/pytest-django#310
@halfnibble |
As noted in ojake's PR #270 (which was created to address #264), the issue with the implementation of the pytest.mark.django_use_model mark that caused tests not to be collected can be fixed relatively easily by supplying the model argument as a kwarg. (I'm not very familiar with pytest, so there may be a better way of fixing this issue.)
This PR includes: