Add support for testing unmanaged models (updated)#310
Closed
timb07 wants to merge 0 commit intopytest-dev:masterfrom
Closed
Add support for testing unmanaged models (updated)#310timb07 wants to merge 0 commit intopytest-dev:masterfrom
timb07 wants to merge 0 commit intopytest-dev:masterfrom
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'): |
|
What needs to be done to make this a reality? Does anyone want help on this? |
Contributor
|
@halfnibble |
Author
|
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! |
Numerico
added a commit
to Numerico/pytest-django
that referenced
this pull request
Jun 10, 2018
working code from timb07@176ac9f see pytest-dev#270
Numerico
added a commit
to Numerico/medios_bot
that referenced
this pull request
Jun 10, 2018
wordpress unmanaged models needs django_use_model marker see pytest-dev/pytest-django#310
Numerico
added a commit
to Numerico/medios_bot
that referenced
this pull request
Jun 10, 2018
wordpress unmanaged models needs django_use_model marker see pytest-dev/pytest-django#310
Contributor
|
@halfnibble |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: