From 8e5ee2fb19058336afb5af61486e17f2603b56cb Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Sun, 12 May 2013 05:38:51 +0000 Subject: Fixed differences with upstream branch. --- README | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index 4ecc415..cc26087 100644 --- a/README +++ b/README @@ -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() -- cgit v1.2.3