summaryrefslogtreecommitdiff
path: root/tests
Commit message (Expand)AuthorAge
* Remove automagic associated class discovery.Raphaël Barrois2013-03-11
* Remove building_function/creation_function.•••Stop defaulting to Django's .objects.create(). Raphaël Barrois2013-03-11
* Stop calling Foo.objects.create() when it doesn't break (Closes #23).•••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> Raphaël Barrois2013-03-05
* Improve doc on post-generation hooks (Closes #36).•••This was the last missing bit from PR#36 by @gotgenes. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-05
* 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
* Let mock source be chosen by Python major version.•••This should provide better Python 3 compatibility, since mock is in the Python 3 standard library as unittest.mock. Conflicts: tests/test_declarations.py Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Chris Lasher2013-03-04
* 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
* Get rid of the FACTORY_ABSTRACT rename.•••This was just adding noise to an already complex release. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-03
* Improve coverage.•••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
* Tests: improve deprecation warning detection in test_base.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-03-03
* Tests: move disable_warnings to its own class.•••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
* Add test for dual class/factory inheritance.•••If it works properly, this would make pylint happy. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-02-27
* Happy New Year!•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2013-01-02
* Keep FACTORY_FOR around.•••And add a test too. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* Rename ABSTRACT_FACTORY to FACTORY_ABSTRACT.•••And add a deprecation warning too. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* Add an extension point for kwargs mangling.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* 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
* [py3] Rename xrange to range•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* [py3] Disable 'scope bleeding' test on py3.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* [py3] Remove calls to iteritems().•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-11-15
* Add support for passing non-kwarg parameters to factories.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-17
* Improve test coverage.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Disable new warnings in tests.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Refactor building_function/creation_function handling.•••Rely on inheritance instead of handwritten set_creation_function and such. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Mark automatic associated class discovery as deprecated.•••Also improve warning reporting. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Explicitly set FACTORY_FOR in tests.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-08-16
* Add full tests for CircularSubFactory.•••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
* Switch `sorted` argument from `cmp` to `key`.Marc Abramowitz2012-07-10
* Fix TestCase name conflict•••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
* Only absorb dependant arguments for SubFactory fields (Closes #15).•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-05-04
* Rename post_declaration to post_generation.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-04-15
* Expose and test factory.RelatedFactory.•••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
* Make tests compatible with python2.6 + unittest2•••Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr> Raphaël Barrois2012-04-15
* Cleaner extract_dict: allow excluded keys.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-04-15
* Test running improvements: tests can be run under python 2.6 (by using option...Mikhail Korobov2012-04-10
* Move ATTR_SPLITTER logic to a dedicated module.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-04-09
* Fix tests.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-04-07
* Add and document abstract factories (Closes #8).•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-04-07
* Add a '@use_strategy' decorator for forcing alternate strategies.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-03-17
* Add a couple of tests for scope bleeding with InfiniteIterator and list compr...•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-03-09
* Add the Iterator and InfiniteIterator attribute kinds.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-02-24
* Add support for 'generate' and 'simple_generate'•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org> Raphaël Barrois2012-02-24