Skip to content
This repository

Unobtrusive test models creation for django

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 django_any Improove url generation August 02, 2011
Octocat-spinner-32 docs
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Unobtrusive test models creation for django

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):
        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)

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

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

See docs/quickstart.txt for more details
Something went wrong with that request. Please try again.