------------------
Breaking changes
""""""""""""""""
The following aliases were removed:
+================================================+===================================================+
| Broken alias | New import |
+================================================+===================================================+
| ``from factory import DjangoModelFactory`` | ``from factory.django import DjangoModelFactory`` |
+------------------------------------------------+---------------------------------------------------+
| ``from factory import MogoFactory`` | ``from factory.mogo import MogoFactory`` |
+------------------------------------------------+---------------------------------------------------+
| ``from factory.fuzzy import get_random_state`` | ``from factory.random import get_random_state`` |
+------------------------------------------------+---------------------------------------------------+
| ``from factory.fuzzy import set_random_state`` | ``from factory.random import set_random_state`` |
+------------------------------------------------+---------------------------------------------------+
| ``from factory.fuzzy import reseed_random`` | ``from factory.random import reseed_random`` |
+================================================+===================================================+
*Removed:*
- Drop support for Python 2 and 3.4. These versions `are not maintained anymore <https://devguide.python.org/developer-workflow/development-cycle/index.html#end-of-life-branches>`__.
- Drop support for Django 2.0 and 2.1. These versions `are not maintained anymore <https://www.djangoproject.com/download/#supported-versions>`__.
- Remove deprecated ``force_flush`` from ``SQLAlchemyModelFactory`` options. Use
``sqlalchemy_session_persistence = "flush"`` instead.
- Drop deprecated ``attributes()`` from :class:`~factory.Factory` subclasses; use
``factory.make_factory(dict, FactoryClass._meta.pre_declarations)`` instead.
- Drop deprecated ``declarations()`` from :class:`~factory.Factory` subclasses; use ``FactoryClass._meta.pre_declarations`` instead.
- Drop ``factory.compat`` module.
*New:*
- Add support for Python 3.8
- Add support for Django 2.2 and 3.0
- Report misconfiguration when a :py:class:`~factory.Factory` is used as the :py:attr:`~factory.FactoryOptions.model` for another :py:class:`~factory.Factory`.
- Allow configuring the color palette of :py:class:`~factory.django.ImageField`.
- :py:meth:`~factory.random.get_random_state()` now represents the state of Faker and ``factory_boy`` fuzzy attributes.
- Add SQLAlchemy ``get_or_create`` support
*Improvements:*
- :issue:`561`: Display a developer-friendly error message when providing a model instead of a factory in a :class:`~factory.SubFactory` class.
*Bug fix:*
- Fix issue with SubFactory not preserving signal muting behavior of the used factory, thanks `Patrick Stein <https://github.com/PFStein>`_.
- Fix issue with overriding parameters in a Trait, thanks `Grégoire Rocher <https://github.com/cecedille1>`_.
- :issue:`598`: Limit ``get_or_create`` behavior to fields specified in ``django_get_or_create``.
- :issue:`606`: Re-raise :class:`~django.db.IntegrityError` when ``django_get_or_create`` with multiple fields fails to lookup model using user provided keyword arguments.
- :issue:`630`: TypeError masked by __repr__ AttributeError when initializing ``Maybe`` with inconsistent phases.