一个帮助为djangorq编写单元测试的pytest插件
pytest-django-rq的Python项目详细描述
pytest django rq公司
一个pytest插件,帮助编写django rq的单元测试。在
这个插件提供了一个django_rq_worker
fixture,它有一个work()
方法
运行当前进程中所有排队的作业。在
使用
deftest_async_api(django_rq_worker):client=django.test.Client()# Call an async APIresponse=client.post(URL)assertresponse.status_code==201# Accepted# now let's run all enqueued jobsdjango_rq_worker.work()# assert the async jobs has taken place.assert...
- 项目
标签: