You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.
Where can I setup a model for tests only? (For testing abstract models)
In django 1.5 (without installing this app, obviously), I can define the model in tests.py.
With django-nose models defined in test files are installed automatically as well.
Does the discover-runner support this in any way? Without explicitly calling syncdb from the tests?
Thank you!
The text was updated successfully, but these errors were encountered:
No, there isn't really any solution for this in discover-runner. There isn't really in Django core, either - the ability to put models in tests.py is an accident of the current implementation, not a supported feature. There is an open feature request for it, and support from several core developers, so it just needs someone to pick it up and champion a proper solution: https://code.djangoproject.com/ticket/7835
Closing this because I think it's an issue for Django core, not discover-runner.
FWIW, I just tested this in the context of looking into https://code.djangoproject.com/ticket/21164, and it seems that the discover runner still supports installing models located in test files (and its still an accident of implementation, not an intended feature). The only difference is the one observed in that ticket, which is that not all the same tests will necessarily be run with the discover runner, therefore not all the same test-only models will be discovered and installed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
Where can I setup a model for tests only? (For testing abstract models)
In django 1.5 (without installing this app, obviously), I can define the model in
tests.py
.With django-nose models defined in test files are installed automatically as well.
Does the discover-runner support this in any way? Without explicitly calling syncdb from the tests?
Thank you!
The text was updated successfully, but these errors were encountered: