有可能,这是一种方法:
1)定义自己的测试跑步者,看看这里如何。
2)为了让您的自定义测试运行器查看默认的测试运行器,您可以复制并粘贴代码,然后注释以下行:
connection.creation.destroy_test_db(old_name,verbosity)负责销毁测试数据库,我认为您应该
connection.creation.create_test_db(..)尝试一下该行,但要注意的是像这样:
try: # Create the database the first time. connection.creation.create_test_db(verbosity, autoclobber=not interactive) except ..: # Look at the error that this will raise when create a database that already exist # Test database already created. pass
3)将set.py中的TEST_RUNNER绑定到您的测试运行器。
4)现在像这样运行测试:./manage.py test
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)