summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:08:29 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:08:29 +0200
commit15f328350311ee46f84c628310e58e4ed8b49e13 (patch)
treec64334d0b811963817c86353f1a62fd45f4fc7fa
parent57be4ac78b1213928a83079d298bafcc93e69483 (diff)
downloadfactory-boy-15f328350311ee46f84c628310e58e4ed8b49e13.tar
factory-boy-15f328350311ee46f84c628310e58e4ed8b49e13.tar.gz
Docs: Document Faker.add_provider (Closes #218)
-rw-r--r--docs/reference.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index 4c7f8f7..3a57c66 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -534,6 +534,23 @@ Faker
... UserFactory()
<User: Johannes Brahms>
+ .. classmethod:: add_provider(cls, locale=None)
+
+ Some projects may need to fake fields beyond those provided by ``fake-factory``;
+ in such cases, use :meth:`factory.Faker.add_provider` to declare additional providers
+ for those fields:
+
+ .. code-block:: python
+
+ factory.Faker.add_provider(SmileyProvider)
+
+ class FaceFactory(factory.Factory):
+ class Meta:
+ model = Face
+
+ smiley = factory.Faker('smiley')
+
+
LazyAttribute
"""""""""""""