I'm trying to use coverage with Django, but I seem to be getting incorrect results. My app is named "stats" and I have this test:
class ListSchoolsTest(TestCase):
def test_initial_list(self):
self.client.login(username='skeezy', password='skeezy')
resp = self.client.get("/stats/list_schools/")
self.assertEqual(resp.status_code, 200)
On the command line, I run:
coverage run --source="." manage.py test stats
And the test passes. All my views are currently in stats/views.py
But when I run "coverage report", I get this line:
Name Stmts Miss Cover
----------------------------------------
<snip>
stats/views 110 110 0%
Any idea what I am (not) doing that would cause coverage to report all lines missed in stats/views.py, even though it would have to be hit in order for the test to pass? (just as a belt-and-suspenders, I put a print statement in my view, and it's definitely getting hit.)