Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 816 Bytes

quickstart.rst

File metadata and controls

37 lines (23 loc) · 816 Bytes

Installation and Quick Start

Installation

Easiest is to install with pip:

pip install factory_djoy

Quick Start

Factory Djoy provides a UserFactory out of the box which will build valid instances of the default Django contrib auth User model.

from factory_djoy import UserFactory

user = UserFactory()

For any other Django models that you would like valid instances for, create your factory by inheriting from CleanModelFactory.

from factory_djoy import CleanModelFactory

from project.app.models import Item


class ItemFactory(CleanModelFactory):
    class Meta:
        model = Item