vendredi 31 juillet 2015

Django: tests.py as a module

Background:

I'm using Django 1.8.

And I'm beginning to test on it.

When I use the models.py or views.py, I usually remove them, and create a module folder with the same name to replace.

In this way, I can split the models and views to different code files and make them easy to edit.


Question:

But when I tried to change the tests.py to a module folder, I found that the test cases in the __init__.py cannot run.

What's wrong? If I want to do so, is there any way?

Please help, thank you.

Aucun commentaire:

Enregistrer un commentaire