Closed AdrianLC closed 11 years ago
Hi,
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.
Thanks @carljm, I agree, this isn't a feature request this app should handle.
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.
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!