跳转到主要内容

pytest插件,用于帮助编写django-rq的单元测试

项目描述

pytest-django-rq

一个pytest插件,用于帮助编写django-rq的单元测试。

build Code style: black

此插件提供了一个django_rq_worker fixture,它有一个work()方法来运行当前进程中所有排队的作业。

用法

def test_async_api(django_rq_worker):
    client = django.test.Client()

    # Call an async API
    response = client.post(URL)
    assert response.status_code == 201  # Accepted

    # now let's run all enqueued jobs
    django_rq_worker.work()

    # assert the async jobs has taken place.
    assert ...

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

pytest-django-rq-0.2.0.tar.gz (3.2 kB 查看哈希值)

上传时间:

构建分布

pytest_django_rq-0.2.0-py3-none-any.whl (3.8 kB 查看哈希值)

上传时间: Python 3

由以下支持