Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install milkman

How to install milkman

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install milkman
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4.5 Available View build log
0.4.4 Available View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.3a1.dev4 Available View build log
Windows (64-bit)
0.4.5 Available View build log
0.4.4 Available View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.3a1.dev4 Available View build log
Mac OS X (10.5+)
0.4.5 Available View build log
0.4.4 Available View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.3a1.dev4 Available View build log
Linux (32-bit)
0.4.5 Available View build log
0.4.4 Available View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.3a1.dev4 Available View build log
Linux (64-bit)
0.4.5 Available View build log
0.4.4 Available View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.3a1.dev4 Available View build log
 
License
MIT
Dependencies
Imports
Lastest release
version 0.4.5 on Oct 5th, 2011

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

Subscribe to package updates

Last updated Oct 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.