diff options
author | Thomas Goirand <thomas@goirand.fr> | 2013-05-12 05:38:51 +0000 |
---|---|---|
committer | Thomas Goirand <thomas@goirand.fr> | 2013-05-12 05:38:51 +0000 |
commit | 8e5ee2fb19058336afb5af61486e17f2603b56cb (patch) | |
tree | a73e60fd2443584475f4371083644373a8004192 /README | |
parent | 91b2da50daf5a0e95eb7cfdb1fa3668ed2925201 (diff) | |
download | factory-boy-8e5ee2fb19058336afb5af61486e17f2603b56cb.tar factory-boy-8e5ee2fb19058336afb5af61486e17f2603b56cb.tar.gz |
Fixed differences with upstream branch.
Diffstat (limited to 'README')
-rw-r--r-- | README | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -53,7 +53,9 @@ Usage Defining factories """""""""""""""""" -Factories declare a set of attributes used to instantiate an object. The class of the object must be defined in the FACTORY_FOR attribute:: +Factories declare a set of attributes used to instantiate an object. The class of the object must be defined in the FACTORY_FOR attribute: + +.. code-block:: python import factory from . import models @@ -77,7 +79,9 @@ Factories declare a set of attributes used to instantiate an object. The class o Using factories """"""""""""""" -factory_boy supports several different build strategies: build, create, attributes and stub:: +factory_boy supports several different build strategies: build, create, attributes and stub: + +.. code-block:: python # Returns a User instance that's not saved user = UserFactory.build() @@ -89,7 +93,9 @@ factory_boy supports several different build strategies: build, create, attribut attributes = UserFactory.attributes() -You can use the Factory class as a shortcut for the default build strategy:: +You can use the Factory class as a shortcut for the default build strategy: + +.. code-block:: python # Same as UserFactory.create() user = UserFactory() |