summaryrefslogtreecommitdiff
path: root/factory/declarations.py
Commit message (Expand)AuthorAge
* Pylint.Raphaël Barrois2013-04-03
* internal: merge OrderedDeclaration.evaluate() variants.Raphaël Barrois2013-04-03
* declarations: minor code simplificationRaphaël Barrois2013-04-02
* Default Sequence.type to int (Closes #50).Raphaël Barrois2013-03-24
* Add full Python 3 compatibility (Closes #10, #20, #49).•••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> nkryptic2013-03-15
* Remove extract_prefix from post-generation hooks.•••Magic abuse is bad. Raphaël Barrois2013-03-11
* Remove CircularSubFactory.•••Replace CircularSubFactory('module', 'symbol') with SubFactory('module.symbol'). Raphaël Barrois2013-03-11
* Remove InfiniteIterator and infinite_iterator.•••Use Iterator/iterator instead. Raphaël Barrois2013-03-11
* Cleanup argument extraction in PostGenMethod (See #36).•••This provides a consistent behaviour for extracting arguments to a PostGenerationMethodCall. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-05
* Use extracted argument in PostGenerationMethodCall.•••This changeset makes it possible possible to override the default method arguments (or "method_args") passed in when instantiating PostGenerationMethodCall. Now the user can override the default arguments to the method called during post-generation when instantiating a factory. For example, using this UserFactory, class UserFactory(factory.Factory): FACTORY_FOR = User username = factory.Sequence(lambda n: 'user{0}'.format(n)) password = factory.PostGenerationMethodCall( 'set_password', None, 'defaultpassword') by default, the user will have a password set to 'defaultpassword', but this can be overridden by passing in a new password as a keyword argument: >>> u = UserFactory() >>> u.check_password('defaultpassword') True >>> other_u = UserFactory(password='different') >>> other_u.check_password('defaultpassword') False >>> other_u.check_password('different') True This changeset introduces a testing dependency on the Mock package http://pypi.python.org/pypi/mock. While this is a third-party dependency in Python 2, it is part of the Python 3 standard library, as unit.mock, and so a reasonable dependency to satisfy. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Chris Lasher2013-03-04
* Add a 'after post_generation' hook to Factory.•••Use it in DjangoModelFactory to save objects again if a post_generation hook ran. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-04
* Allow symbol names in RelatedFactory (Closes #30).•••This works exactly as for SubFactory. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-03
* Deprecate the extract_prefix option to PostGeneration.•••Introduces a new, call-less syntax for the @post_generation decorator. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-03
* Improve Iterator and SubFactory declarations.•••* Iterator now cycles by default * Iterator can be provided with a custom getter * SubFactory accepts a factory import path as well Deprecates: * InfiniteIterator * CircularSubFactory Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-03
* Happy New Year!•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-01-02
* Mix SelfAttribute with ContainerAttribute.•••With a very simple syntax. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* [py3] Various python3-compatibility fixes.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* Improve test coverage.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Introduce 'CircularSubFactory.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-09
* Fix PostGenerationDeclaration.extract.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-07-09
* Fix sequence count for SubFactory (Closes #16).•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-06-01
* Typo in PostGenerationMethodCall.__init__ (Closes #14).•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-05-02
* Rename post_declaration to post_generation.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-04-15
* Handle the PostGeneration declarations.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-04-15
* Add basis for PostGenerationDeclaration•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-04-15
* Add the Iterator and InfiniteIterator attribute kinds.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-02-24
* Improve the 'SelfAttribute' syntax.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> v1.1.0Raphaël Barrois2012-02-24
* Improve documentation.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-02-24
* Allow using '__' in factory.SelfAttribute.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-02-24
* Rename LazyContainerAttibute to ContainerAttribute.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-01-12
* Add support for 'LazyContainerAttribute', when a SubFactory field needs acces...•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-01-12
* Cleanup 'factory.declarations'.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2011-12-21
* Add encoding header.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2011-12-21
* Update copyrights.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2011-12-21
* Rewrite all the 'OrderedDeclaration' part.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-09-06
* Huge refactoring and code cleanup.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-09-06
* Update docstrings.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2011-09-05
* Use the same sequence counter for parent and child classes.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-08-10
* Add a new type of attribute, SelfAttribute.•••Should be used as a shortcut for 'lambda o: o.some_attr' ; most useful in SubFactories. Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-06-13
* Fix the SubFactory/Sequence behaviour.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-05-24
* Add SubFactories, and full testing.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-05-16
* Fix concurrency between declarations for LazyAttributes and Sequence.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-05-11
* Remove trailing whitespace•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2011-05-11
* factory_boy: a test fixtures replacement based on thoughtbot's factory_girl f...Mark Sandstrom2010-08-22