Welcome to milkman’s documentation
milkman is an open source fixture replacement for Django testing.
Instead of maintaining scores of fixtures, whether they be generated, dumped, or managed semi-dynamically, it can still generate a lot of code that is not even test code. Furthermore, this tends to be brittle and hard to maintain.
The genius of milkman is that it randomly generates data for all the fields on a particular object, while at the same time allowing the test writer to override any particular field with their own data when determinate fields are needed for a test.
Example:
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from milkman.dairy import milkman
from app.models import Library, Book, Author
class LibraryTest(TestCase):
def setUp(self):
self.user = milkman.deliver(User)
self.user.set_password("letmein")
self.user.save()
self.user2 = milkman.deliver('auth.user')
self.user2.set_password("letmein")
self.user2.save()
self.book = milkman.deliver(Book, library__name="Library of Congress")
self.author = milkman.deliver(Author, lastname="Lewis")
self.client = Client()
self.client.login(username=self.user.username, password="letmein")
self.url = reverse("book", args=[self.book.library.id, self.book.id])
def tearDown(self):
self.user.delete()
self.user2.delete()
self.book.delete()
self.author.delete()
Metadata
Release files for milkman 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| milkman-0.5.tar.gz | 7.7 kB | Without provenance | Details |
Release files / milkman-0.5.tar.gz
| Download URL | milkman-0.5.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fd6b9c450fe660a6474d0ca4e36252764519c960e12ed43cbce7bf795ea2a56
|
|
BLAKE2b-256 checksum How to use checksums |
735a5cd05a57dfcd215a927087797ed7592d3a0798134eed6dacd56be9c03057
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for milkman 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.