Opened 14 years ago
Closed 14 years ago
#13985 closed (duplicate)
tests does not recognize non models.py apps
Reported by: | Jari Pennanen | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
- Create Django app e.g.
yourapp
withoutmodels.py
- Create
tests.py
inside your app. - Try to test this app using
manage.py test yourapp
It throws an error, why? I have many Django apps I prefer to test and they don't have a single model in them and never need to.
Currently workaround is to create empty models.py
to your app, though it is not very clean. Someone hasty might think that app has models, when in fact it is just templatetag library app or something like that with empty models.py
.
Note:
See TracTickets
for help on using tickets.
This is a duplicate of #7198 that covers the more general problem and in detail.