Opened 12 years ago
Closed 11 years ago
#18670 closed Bug (wontfix)
Tests are loaded from models.py before tests.py, causes false negative
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | flo@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have app/models/foo.py
, containing a model with app_label
set appropriately. I also have app/tests.py
containing a test case called foo
. When I run manage.py test app.foo
, I am greeted with:
ValueError: Test label 'app.foo' does not refer to a test
Change History (9)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Needs tests: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:3 by , 12 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
comment:6 by , 12 years ago
Cc: | added |
---|---|
Has patch: | set |
Needs tests: | unset |
Version: | 1.4 → master |
I've added a test to Bradley's patch and created a new pull request: https://github.com/django/django/pull/849
comment:8 by , 12 years ago
This will be rendered irrelevant by #17365, which doesn't load tests from models.py
at all, and deprecates the code changed in this patch.
comment:9 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Closing wontfix, as the new test runner merged in #17365 does not support tests in models.py
, and the old runner is deprecated.
Code looks good, probably should have tests in django/tests/test_runner