Opened 18 years ago
Closed 16 years ago
#3310 closed defect (duplicate)
manage.py test does not work if there is not a model.py in the application
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | akaihol+django@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a project where I am not using any models. My appdir looked like
app/views.py app/__init__.py app/tests.py
I created a tests.py and the get_apps would fail to find the application, even though it was listed under installed apps. When running ./manage.py test app, it would fail saying there was no application with that label.
Attachments (2)
Change History (7)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 18 years ago
Attachment: | test_applications_with_no_models.patch added |
---|
comment:2 by , 18 years ago
Has patch: | set |
---|---|
Needs tests: | set |
I created a patch for this, but I did not create tests... (I was not really sure how to creat tests for it :-))
If someone is interested in using this and add the tests instead of starting from scratch, that would be great.
by , 18 years ago
Attachment: | test_applications_with_no_models.version_2.patch added |
---|
this should replace the previous patch
comment:3 by , 17 years ago
This problem has an easy workaround 'touch models.py' in relevant apps.
It can still is a bit of a gotcha though(some of my unittests weren't running for couple months and still wouldn't be if I hadn't added one and noticed the test count not increment). So, I'm working on a minimal patch to resolve this issue.
comment:4 by , 17 years ago
Cc: | added |
---|
There's an overlapping patch for the problem of testing models in separate files in #5751. It would make sense to merge these patches.
comment:5 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I could reproduce this.