Latest version: 3.0.2 (Jan 2020)
Django Dynamic Fixture (DDF) is a complete and simple library to create dynamic model instances for testing purposes.
It lets you focus on your tests, instead of focusing on generating some dummy data which is boring and polutes the test source code.
http://django-dynamic-fixture.readthedocs.org/en/latest/index.html
from ddf import G
def test_search_book_by_author():
author1 = G(Author)
author2 = G(Author)
book1 = G(Book, authors=[author1], main_author__name='Eistein')
book2 = G(Book, authors=[author2])
books = Book.objects.search_by_author(author1.name)
assert book1 in books
assert book2 not in books
assert book1.main_author.name == 'Eistein'