sdkagent

factory_boy API reference

64 public APIs from factory_boy (FactoryBoy/factory_boy) — 52 classes, 3 functions, 9 methods. Signatures extracted by static analysis of the actual source.

Repository: FactoryBoy/factory_boy

KindCount
Classes52
Functions3
Methods9

API list

classfactory.alchemy.SQLAlchemyModelFactory
Factory for SQLAlchemy models.
classfactory.base.BaseDictFactory
Factory for dictionary-like classes.
classfactory.base.BaseFactory
Factory base support for sequences, attributes and stubs.
methodfactory.base.BaseFactory.generate(strategy, **kwargs)
Generate a new instance.
methodfactory.base.BaseFactory.generate_batch(strategy, size, **kwargs)
Generate a batch of instances.
methodfactory.base.BaseFactory.reset_sequence(value=None, force=False)
Reset the sequence counter.
methodfactory.base.BaseFactory.simple_generate(create, **kwargs)
Generate a new instance.
classfactory.base.BaseListFactory
Factory for list-like classes.
classfactory.base.Factory
Factory base with build and create support.
classfactory.base.FactoryMetaClass
Factory metaclass for handling ordered declarations.
classfactory.base.OptionDefault
The default for an option.
classfactory.base.StubObject
A generic container.
funcfactory.base.use_strategy(new_strategy)
Force the use of a different strategy.
classfactory.builder.DeclarationSet
A set of declarations, including the recursive parameters.
classfactory.builder.Resolver
Resolve a set of declarations.
classfactory.builder.StepBuilder
A factory instantiation step.
methodfactory.builder.StepBuilder.build(parent_step=None, force_sequence=None)
Build a factory instance.
methodfactory.builder.StepBuilder.recurse(factory_meta, extras)
Recurse into a sub-factory call.
classfactory.declarations.BaseDeclaration
A factory declaration.
methodfactory.declarations.BaseDeclaration.evaluate(instance, step, extra)
Evaluate this declaration.
classfactory.declarations.Dict
Fill a dict with usual declarations.
classfactory.declarations.Iterator
Fill this value using the values returned by an iterator.
methodfactory.declarations.Iterator.reset()
Reset the internal iterator.
classfactory.declarations.LazyAttribute
Specific BaseDeclaration computed using a lambda.
classfactory.declarations.LazyAttributeSequence
Composite of a LazyAttribute and a Sequence.
classfactory.declarations.List
Fill a list with standard declarations.
classfactory.declarations.OrderedDeclaration
Compatibility
classfactory.declarations.Parameter
A complex parameter, to be used in a Factory.Params section.
classfactory.declarations.ParameteredAttribute
Base class for attributes expecting parameters.
classfactory.declarations.PostGeneration
Calls a given function once the object has been generated.
classfactory.declarations.PostGenerationMethodCall
Calls a method of the generated object.
classfactory.declarations.RelatedFactory
Calls a factory once the object has been generated.
classfactory.declarations.SelfAttribute
Specific BaseDeclaration copying values from other fields.
classfactory.declarations.Sequence
Specific BaseDeclaration to use for 'sequenced' fields.
classfactory.declarations.SubFactory
Base class for attributes based upon a sub-factory.
classfactory.declarations.Transformer.Force
Bypass a transformer's transformation.
classfactory.django.DjangoModelFactory
Factory for Django models.
classfactory.django.FileField
Helper to fill in django.db.models.FileField from a Factory.
methodfactory.django.FileField.evaluate(instance, step, extra)
Fill in the field.
funcfactory.django.get_model(app, model)
Wrapper around django's get_model.
classfactory.django.mute_signals
Temporarily disables and then restores any django signals.
classfactory.errors.AssociatedClassError
Exception for Factory subclasses lacking Meta.model.
classfactory.errors.CyclicDefinitionError
Raised when a cyclical declaration occurs.
classfactory.errors.FactoryError
Any exception raised by factory_boy.
classfactory.errors.InvalidDeclarationError
Raised when a sub-declaration has no related declaration.
classfactory.errors.UnknownStrategy
Raised when a factory uses an unknown strategy.
classfactory.faker.Faker
Wrapper for 'faker' values.
classfactory.fuzzy.BaseFuzzyAttribute
Base class for fuzzy attributes.
classfactory.fuzzy.BaseFuzzyDateTime
Base class for fuzzy datetime-related attributes.
classfactory.fuzzy.FuzzyAttribute
Similar to LazyAttribute, but yields random values.
classfactory.fuzzy.FuzzyChoice
Handles fuzzy choice of an attribute.
classfactory.fuzzy.FuzzyDate
Random date within a given date range.
classfactory.fuzzy.FuzzyDateTime
Random timezone-aware datetime within a given range.
classfactory.fuzzy.FuzzyDecimal
Random decimal within a given range.
classfactory.fuzzy.FuzzyFloat
Random float within a given range.
classfactory.fuzzy.FuzzyInteger
Random integer within a given range.
classfactory.fuzzy.FuzzyNaiveDateTime
Random naive datetime within a given range.
classfactory.fuzzy.FuzzyText
Random string with a given prefix.
classfactory.mogo.MogoFactory
Factory for mogo objects.
classfactory.mongoengine.MongoEngineFactory
Factory for mongoengine objects.
classfactory.utils.OrderedBase
Marks a class as being ordered.
classfactory.utils.ResetableIterator
An iterator wrapper that can be 'reset()' to its start.
classfactory.utils.log_pprint
Helper for properly printing args / kwargs passed to an object.
funcfactory.utils.sort_ordered_objects(items, getter=lambda x: x)
Sort an iterable of OrderedBase instances.

About this data

These signatures were extracted from the public source of FactoryBoy/factory_boy using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries