擅长:python、mysql、java
<p>您可以利用django测试运行程序命令测试的方式(参见<a href="https://docs.djangoproject.com/en/1.11/topics/testing/overview/#order-in-which-tests-are-executed" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.11/topics/testing/overview/#order-in-which-tests-are-executed</a>)</p>
<p>如果您的测试用例是从django的TestCase类继承的,那么您可以创建一个直接继承自的虚拟清理测试用例unittest.TestCase. 测试运行程序将最后执行,您可以在那里进行清理。在</p>
<p>但是,如果django开发人员决定对测试顺序进行更改,这将中断。在</p>