Opened 12 years ago

Closed 12 years ago

#18670 closed Bug (wontfix)

Tests are loaded from models.py before tests.py, causes false negative

Reported by: Bradley Ayers <bradley.ayers@…> 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 Chris Beaven, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Chris Beaven, 12 years ago

Needs tests: set
Triage Stage: AcceptedReady for checkin

Code looks good, probably should have tests in django/tests/test_runner

comment:3 by Chris Beaven, 12 years ago

Triage Stage: Ready for checkinAccepted

comment:4 by Simon Charette, 12 years ago

Where's the code? Missing PR reference?

comment:5 by Bradley Ayers <bradley.ayers@…>, 12 years ago

comment:6 by fhahn, 12 years ago

Cc: flo@… added
Has patch: set
Needs tests: unset
Version: 1.4master

I've added a test to Bradley's patch and created a new pull request: https://github.com/django/django/pull/849

comment:7 by Aymeric Augustin, 12 years ago

Related: #17366

comment:8 by Carl Meyer, 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 Carl Meyer, 12 years ago

Resolution: wontfix
Status: newclosed

Closing wontfix, as the new test runner merged in #17365 does not support tests in models.py, and the old runner is deprecated.

Note: See TracTickets for help on using tickets.
Back to Top