Skip to main content

Unobtrusive test models creation for django.

Project description

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

django-any allows to specify only fields important for test, and fill rest by random with acceptable values.

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

from django_any import any_model, WithTestDataSeed

class TestMyShop(TestCase):
    __metaclass__ = WithTestDataSeed

    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)

The same approach available for forms also (django_any.any_form)

See docs/quickstart.txt for more details

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-any-0.2.0.tar.gz (13.4 kB view details)

Uploaded Source

File details

Details for the file django-any-0.2.0.tar.gz.

File metadata

  • Download URL: django-any-0.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-any-0.2.0.tar.gz
Algorithm Hash digest
SHA256 74e631fccc4964a804f0e2f0c392bce13b36633d8199aad1f49e0c215e227059
MD5 11f194396e0888cf126d65858892d98f
BLAKE2b-256 11a0d1de9136e7193b78f2dc6ed2bf8c0e4bf8e7d0485ede124a14d67d9e417c

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