Skip to main content

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.

build Code style: black

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


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.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pytest_django_rq-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-django-rq-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-django-rq-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 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

Hashes for pytest-django-rq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad80131c0932f631da7a3612df974bbfee7da7fc6dc4a7978d4749fa734f7f80
MD5 4524d928ba867430116edcc6a4ad60aa
BLAKE2b-256 85826dfe68ac2cfe9b4db4d575f5d640da497c7a59202d8edd0493908d0ad9f5

See more details on using hashes here.

File details

Details for the file pytest_django_rq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_django_rq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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

Hashes for pytest_django_rq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab1fbe2428c8513de12487801434b7e4d91b6ce5d48c5ad32130b41285fed4b2
MD5 ac93303d99d51049f6cb67e650566874
BLAKE2b-256 e4061770d5527db1f30b400d8eba4408c84c7db5291d542351d562987e70395b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page