A pytest plugin to help writing unit test for django-rq
Project description
pytest-django-rq
A pytest plugin to help writing unit test for django-rq.
This plugin provides a django_rq_worker
fixture which has a work()
method
to run all enqueued jobs in current process.
Usage
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 ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytest-django-rq-0.2.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for pytest_django_rq-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02f85b3bd3f2082359c3e509df0e3bc7f1b386d141f64f4aea4e95bf7e2fcc8 |
|
MD5 | 247f957c2515cb6e949d3ea47f312331 |
|
BLAKE2b-256 | eb713a44c11d8e2fb30eec3e3fe535ff16d4a1d79f154a10614a3eb1360f3e7e |