How can I rerun Django test with correct module path?

Hi I'm currently evaluating PyCharm and just hooked up my tests of a Django project I'm working on.

The tests run fine and I get the results, that I would expect from running the entire set of tests.

When I try to rerun a failed test, it tries to look for it under "tests.FoobarTestCase" and fails with "ImportError: No module named tests". The tests are included in my internal Django apps itself. The folder structure is like :

src/
  appname/
    views.py
    models.py
    foobar.py
    ...
    test/
      views_test.py
      models_tests.py
      foobar_tests.py
      ...

So with this in mind it should rerun the test under "appname.tests.foobar_tests.FoobarTestCase", which is also the exact path that shows up in the Test Results section.

Is there any way to tell PyCharm to keep the module path as it has already listed before and then rerun the tests?

Please sign in to leave a comment.