Skip to main content

Unobtrusive test models creation for django.

Project description

django-whatever is a friendly fork of django-any package written by Mikhail Podgurskiy (kmmbvnr) 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.

Source Distribution

django-whatever-0.2.1.tar.gz (134.4 kB view details)

Uploaded Source

File details

Details for the file django-whatever-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-whatever-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1dcbb50678622e096563873f9e6040330243eadfb444e575eb8d062d4bde085c
MD5 a50687970b473f90e3456009f4ef7c2e
BLAKE2b-256 9ccbccf538aa0e317529a2217b5688fb6c7adb742741a55c520587fee1c4c2ec

See more details on using hashes here.

Supported by

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