Skip to main content

Unobtrusive test models creation for django.

Project description

Unobtrusive test models creation for django

Ivelum’s repo is a friendly fork of the django-any package written by Mikhail Podgurskiy (kmmbvnr) and the original django-whatever repository created and maintained by Ilya Baryshev (coagulant)

The purpose of the fork is to fix most annoying bugs and add some features To remain compatible with original package django-whatever retains same namespace: django_any.

django-whatever is explicit replacement for old-style, big and error-prone implicit fixture files.

django-whatever allows you to specify only fields important for tests and fills the rest randomly with acceptable values.

It makes tests clean and easy to understand, without reading fixture files.:

from django_any import any_model

class TestMyShop(TestCase):
    def test_order_updates_user_account(self):
        account = any_model(Account, amount=25, user__is_active=True)
        order = any_model(Order, user=account.user, amount=10)
        order.proceed()

        account = Account.objects.get(pk=account.pk)
        self.assertEquals(15, account.amount)

Read more at the docs: http://django-whatever.readthedocs.org/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-whatever, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size django_whatever-0.3-py3-none-any.whl (15.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-whatever-0.3.tar.gz (22.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page