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
Built Distribution
File details
Details for the file pytest-django-rq-0.2.0.tar.gz
.
File metadata
- Download URL: pytest-django-rq-0.2.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63a76b3c89c592e384b7b370d33e634cc0bbd9bdf50ef06355d79e491b28cb0e |
|
MD5 | ea2f2b0e6b0ba326a1124b2f393fcc78 |
|
BLAKE2b-256 | 9bd250153d25fbed4f728b3a19419fc3f1f3f10a81ff49ea4400a7cf80ba29e9 |
File details
Details for the file pytest_django_rq-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_django_rq-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02f85b3bd3f2082359c3e509df0e3bc7f1b386d141f64f4aea4e95bf7e2fcc8 |
|
MD5 | 247f957c2515cb6e949d3ea47f312331 |
|
BLAKE2b-256 | eb713a44c11d8e2fb30eec3e3fe535ff16d4a1d79f154a10614a3eb1360f3e7e |