summaryrefslogtreecommitdiff
path: root/factory/base.py
Commit message (Collapse)AuthorAge
* Add a new Params section to factories.Raphaël Barrois2016-04-02
| | | | | | | | | | | | This handles parameters that alter the declarations of a factory. A few technical notes: - A parameter's outcome may alter other parameters - In order to fix that, we perform a (simple) cyclic definition detection at class declaration time. - Parameters may only be either naked values or ComplexParameter subclasses - Parameters are never passed to the underlying class
* Refactor: move error defs to a dedicated module.Raphaël Barrois2016-04-02
|
* Add Meta.rename to handle name conflicts (See #206).Raphaël Barrois2015-05-20
| | | | | | Define ``Meta.rename = {'attrs': 'attributes'}`` if your model expects a ``attributes`` kwarg but you can't define it since it's already reserved by the ``Factory`` class.
* Update header years.Raphaël Barrois2015-03-26
|
* Remove limitations of factory.StubFactory (Closes #131).Raphaël Barrois2015-03-26
| | | | | ``StubFactory.build()`` is now supported, and maps to ``StubFactory.stub()``.
* Fix bad default value for Factory.declarations (Closes #162).Raphaël Barrois2015-03-03
|
* Remove deprecated features.Raphaël Barrois2014-11-18
| | | | | This disables the ``FACTORY_FOR`` syntax and related parameters, that should be declared through ``class Meta``.
* Fix declaration inheritance.Raphaël Barrois2014-06-23
|
* Rename hidden/arg_parameters to exclude/inline_args.Raphaël Barrois2014-05-18
|
* Rename 'target' to 'model'.Raphaël Barrois2014-05-18
|
* Add DeprecationWarning for FACTORY_* kwargsRaphaël Barrois2014-05-18
|
* Switch tests to class Meta.Raphaël Barrois2014-05-18
|
* factory.django: Fix counter inheritance with abstract models.Raphaël Barrois2014-05-18
|
* Switch FACTORY_FOR and related to 'class Meta'.Raphaël Barrois2014-05-18
| | | | | | | This is easier to declare, avoids cluttering the namespace, and provides entry points for ORM-specific customization. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* django: Fix lazy loading of 'son' factories (Closes #109).Raphaël Barrois2013-11-25
|
* Fix Django sequences with abstract base models.Raphaël Barrois2013-09-25
|
* Properly handle Sequence & inheritance (Closes #93).Raphaël Barrois2013-09-17
| | | | | There was also a nasty bug: with class FactoryB(FactoryA), FactoryB's sequence counter started at the value of FactoryA's counter when FactoryB was first called.
* Allow FACTORY_FOR = 'app.Model' for Django (Closes #66).Raphaël Barrois2013-08-28
|
* Remove duplicate SQLAlchemyModelFactory (Closes #83).Raphaël Barrois2013-08-28
|
* Make ABSTRACT_FACTORY optional (Closes #74)Raphaël Barrois2013-08-13
| | | | | | | | It will be automatically set to True if neither the Factory subclass nor its parents define a FACTORY_FOR argument. It can also be set on a Factory subclass to prevent it from being called.
* Added SQLAlchemy supportminimumserious2013-06-20
|
* Cleanup PostGenerationDeclaration extraction context.Raphaël Barrois2013-06-15
|
* Properly handle passed-in None in RelatedFactory (Closes #62).Raphaël Barrois2013-06-14
| | | | Thanks to @Dhekke for the help!
* Add logging calls (Closes #45).Raphaël Barrois2013-06-14
|
* Add Factory.reset_sequence.Raphaël Barrois2013-06-10
|
* Move DjangoModelFactory / MogoFactory to their own modules.Raphaël Barrois2013-06-09
|
* Don't use objects.get_or_create() unless required.Raphaël Barrois2013-04-16
|
* Release v2.0.1v2.0.1Raphaël Barrois2013-04-16
|
* Add Dict/List declarations (Closes #18).Raphaël Barrois2013-04-15
|
* Allow overriding the sequence counter.Raphaël Barrois2013-04-15
|
* Pylint.Raphaël Barrois2013-04-03
|
* Add support for get_or_create in DjangoModelFactory.Raphaël Barrois2013-04-02
|
* Add Factory.FACTORY_HIDDEN_ARGS.Raphaël Barrois2013-04-02
| | | | | Fields listed in this class attributes will be removed from the kwargs dict passed to the associated class for building/creation.
* Add full Python 3 compatibility (Closes #10, #20, #49).nkryptic2013-03-15
| | | | | | | | Also: - update travis.yml to build against 2.6-2.7 and 3.2-3.3 - Switch to relative imports Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Make the Factory class Py3 compatible.Raphaël Barrois2013-03-15
| | | | Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Merge Factory into BaseFactory.Raphaël Barrois2013-03-15
| | | | Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Fix exception hierarchy.Raphaël Barrois2013-03-15
| | | | Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Merge BaseFactoryMetaClass into FactoryMetaClass.Raphaël Barrois2013-03-15
| | | | | | Also fix FACTORY_STRATEGY. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Remove unused constants.Raphaël Barrois2013-03-15
| | | | Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Remove automagic associated class discovery.Raphaël Barrois2013-03-11
|
* Remove building_function/creation_function.Raphaël Barrois2013-03-11
| | | | Stop defaulting to Django's .objects.create().
* Add FACTORY_CLASS kwarg to make_factory and friends.Raphaël Barrois2013-03-11
|
* Proper manager fetching in DjangoModelFactory.Raphaël Barrois2013-03-11
|
* Stop calling Foo.objects.create() when it doesn't break (Closes #23).Raphaël Barrois2013-03-05
| | | | | | | | | This will be properly fixed in v2.0.0; the current heuristic is: - If the user defined a custom _create method, use it - If he didn't, but the associated class has a objects attribute, use TheClass.objects.create(*args, **kwargs) - Otherwise, simply call TheClass(*args, **kwargs). Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Add a 'after post_generation' hook to Factory.Raphaël Barrois2013-03-04
| | | | | | Use it in DjangoModelFactory to save objects again if a post_generation hook ran. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Get rid of the FACTORY_ABSTRACT rename.Raphaël Barrois2013-03-03
| | | | | | This was just adding noise to an already complex release. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Happy New Year!Raphaël Barrois2013-01-02
| | | | Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
* Add classmethod decorator to child factories methodsobiwanus2012-12-09
| | | | | | Closes #33,#34 Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
* Fix pk lookup in _setup_next_sequence method.Eduard Iskandarov2012-12-09
| | | | | | Closes #31 Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
* Keep FACTORY_FOR around.Raphaël Barrois2012-11-15
| | | | | | And add a test too. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>