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
Release history Release notifications | RSS feed
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.1.0.tar.gz
(13.3 kB
view details)
File details
Details for the file django-any-0.1.0.tar.gz
.
File metadata
- Download URL: django-any-0.1.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2efef0ab989e704004cf0363e84f16c698ac5997c52ee9ddcb88dccd8f546400 |
|
MD5 | 2a24d2b6628c98ec089f3e51e2dae7ca |
|
BLAKE2b-256 | 6dfd6f1bfe43fd45aac9b0a6b7ff42d9b7a74066dd570a5b3564f55bf2ec329e |