This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

asyncio unit tests with Django transactional support.

It supports Django 1.8+ for Python versions 3.5+ and uses asynctest under the covers to provide support for easily mocking coroutines.

Installation

You can install django-async-test either via the Python Package Index (PyPI) or from github.

To install using pip;

$ pip install django-async-test

From github;

$ pip install git+https://github.com/alexhayes/django-async-test.git

Usage

asynctest.TestCase does a great job of mocking coroutines however if you’re writing tests that manipulate the database in Django you’ll most likely want to ensure that things are cleaned up after your test.

With django_async_test.TestCase you have the coroutine support of asynctest.TestCase but with the transaction support of Django’s django.test.TestCase.

import django_async_test

class MyTestCase(django_async_test.TestCase):

    @django_async_test.patch('myapp.my_coroutine')
    def test_foo(self, MockMyCoroutine):

        # Mock our coroutine.
        MockMyCoroutine.return_value = 'Hello World'

        # Create an instance of MyModel
        MyModel.objects.create(...)

        ...
        ...

In the above example, the test is run inside a transaction by Django’s TestCase, thus the creation of a MyModel will be rolled back, cleaning up the database.

Also, our co-routine will be patched correctly by asynctest.

License

This software is licensed under the MIT License. See the LICENSE file.

Author

Alex Hayes <alex@alution.com>

Release History

Release History

0.2.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-async-test-0.2.2.tar.gz (873.7 kB) Copy SHA256 Checksum SHA256 Source May 9, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting