Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

A complete library to create dynamic model instances for testing purposes.

License

Notifications You must be signed in to change notification settings

Assistr/django-dynamic-fixture

 
 

Repository files navigation

Django Dynamic Fixture

Build Status Docs Status Coverage Status PyPI version PyPI - Python Version PyPI - Downloads

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.

Documentation

http://django-dynamic-fixture.readthedocs.org/en/latest/index.html

Basic example

    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'

About

A complete library to create dynamic model instances for testing purposes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.2%
  • Makefile 1.8%