diff options
author | Christopher Baines <mail@cbaines.net> | 2016-05-11 09:49:51 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2016-05-11 09:49:51 +0100 |
commit | d54b452452a04f8109ef8dc48c9b46d1cb99f476 (patch) | |
tree | a31e97328932c485d80e3be808c9e3572d955c39 /README.rst | |
parent | 36ef8928c06a4bba5249442cd832a73ece1570c3 (diff) | |
parent | f1ed74e06dfb6851bc691ebfd8135c875154ad50 (diff) | |
download | factory-boy-d54b452452a04f8109ef8dc48c9b46d1cb99f476.tar factory-boy-d54b452452a04f8109ef8dc48c9b46d1cb99f476.tar.gz |
Merge tag 'v2.7.0' into debian/unstable
Release of factory_boy 2.7.0
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -80,7 +80,7 @@ Links * Package: https://pypi.python.org/pypi/factory_boy/ * Mailing-list: `factoryboy@googlegroups.com <mailto:factoryboy@googlegroups.com>`_ | https://groups.google.com/forum/#!forum/factoryboy -factory_boy supports Python 2.6, 2.7, 3.2 to 3.5, as well as PyPy; it requires only the standard Python library. +factory_boy supports Python 2.7, 3.2 to 3.5, as well as PyPy; it requires only the standard Python library. Download @@ -226,6 +226,7 @@ These "lazy" attributes can be added as follows: first_name = 'Joe' last_name = 'Blow' email = factory.LazyAttribute(lambda a: '{0}.{1}@example.com'.format(a.first_name, a.last_name).lower()) + date_joined = factory.LazyFunction(datetime.now) .. code-block:: pycon @@ -233,6 +234,10 @@ These "lazy" attributes can be added as follows: "joe.blow@example.com" +.. note:: ``LazyAttribute`` calls the function with the object being constructed as an argument, when + ``LazyFunction`` does not send any argument. + + Sequences """"""""" @@ -287,6 +292,17 @@ The associated object's strategy will be used: True +ORM Support +""""""""""" + +factory_boy has specific support for a few ORMs, through specific ``factory.Factory`` subclasses: + +* Django, with ``factory.django.DjangoModelFactory`` +* Mogo, with ``factory.mogo.MogoFactory`` +* MongoEngine, with ``factory.mongoengine.MongoEngineFactory`` +* SQLAlchemy, with ``factory.alchemy.SQLAlchemyModelFactory`` + + Debugging factory_boy """"""""""""""""""""" @@ -321,16 +337,6 @@ This will yield messages similar to those (artificial indentation): BaseFactory: Generating tests.test_using.TestModel2Factory(two=<tests.test_using.TestModel object at 0x1e15410>) -ORM Support -""""""""""" - -factory_boy has specific support for a few ORMs, through specific ``factory.Factory`` subclasses: - -* Django, with ``factory.django.DjangoModelFactory`` -* Mogo, with ``factory.mogo.MogoFactory`` -* MongoEngine, with ``factory.mongoengine.MongoEngineFactory`` -* SQLAlchemy, with ``factory.alchemy.SQLAlchemyModelFactory`` - Contributing ------------ |