From da8d2e6323014be6065a9a490754173859fb95b4 Mon Sep 17 00:00:00 2001 From: Pauly Fenwar Date: Wed, 6 May 2015 13:54:31 +0100 Subject: Update README.rst - "attributes" is not a strategy (Closes #204). The wording of the readme suggested that "attributes" is a strategy just like "build" and "create", but this is not the case in the implementation (for example keyword arguments do not work, SubFactory fields don't behave as expected), so I have removed the mention of this and replaced the attributes example to mention the "stub" strategy. --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 59ea0cf..991180f 100644 --- a/README.rst +++ b/README.rst @@ -64,7 +64,7 @@ Its main features include: - Straightforward declarative syntax - Chaining factory calls while retaining the global context -- Support for multiple build strategies (saved/unsaved instances, attribute dicts, stubbed objects) +- Support for multiple build strategies (saved/unsaved instances, stubbed objects) - Multiple factories per class support, including inheritance @@ -135,7 +135,7 @@ The class of the object must be defined in the ``model`` field of a ``class Meta Using factories """"""""""""""" -factory_boy supports several different build strategies: build, create, attributes and stub: +factory_boy supports several different build strategies: build, create, and stub: .. code-block:: python @@ -145,8 +145,8 @@ factory_boy supports several different build strategies: build, create, attribut # Returns a saved User instance user = UserFactory.create() - # Returns a dict of attributes that can be used to build a User instance - attributes = UserFactory.attributes() + # Returns a stub object (just a bunch of attributes) + obj = UserFactory.stub() You can use the Factory class as a shortcut for the default build strategy: -- cgit v1.2.3