Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Update factory-boy to 3.0.1 #315

Closed
wants to merge 1 commit into from

Conversation

pyup-bot
Copy link
Contributor

This PR updates factory-boy from 2.11.1 to 3.0.1.

Changelog

3.0.1

------------------

*Bugfix:*

 - :issue:`769`: Fix ``import factory; factory.django.DjangoModelFactory`` and similar calls.

3.0.0

------------------

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/devcycle/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.Factory.model` for another :py:class:`~factory.Factory`.
 - Allow configuring the color palette of :py:class:`~factory.django.ImageField`.
 - :py:meth:`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.declarations.SubFactory` class.

*Bugfix:*

 - Fix issue with SubFactory not preserving signal muting behaviour of the used factory, thanks `Patrick Stein <https://github.com/PFStein>`_.
 - Fix issue with overriding params 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.

2.12.0

-------------------

*New:*

 - Add support for Python 3.7
 - Add support for Django 2.1
 - Add :attr:`~factory.fuzzy.FuzzyChoice.getter` to :class:`~factory.fuzzy.FuzzyChoice` that mimics
   the behavior of ``getter`` in :class:`~factory.Iterator`
 - Make the ``extra_kwargs`` parameter of :meth:`~factory.faker.Faker.generate` optional
 - Add :class:`~factory.RelatedFactoryList` class for one-to-many support, thanks `Sean Harrington <https://github.com/seanharr11>`_.
 - Make the `locale` argument for :class:`~factory.faker.Faker` keyword-only

*Bugfix:*

 - Allow renamed arguments to be optional, thanks to `Justin Crown <https://github.com/mrname>`_.
 - Fix `django_get_or_create` behavior when using multiple fields with `unique=True`, thanks to `YPCrumble <https://github.com/YPCrumble>`
Links

@codecov-commenter
Copy link

Codecov Report

Merging #315 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #315   +/-   ##
========================================
  Coverage    97.48%   97.48%           
========================================
  Files           23       23           
  Lines          477      477           
========================================
  Hits           465      465           
  Misses          12       12           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b590f2...78921d0. Read the comment docs.

@pyup-bot
Copy link
Contributor Author

pyup-bot commented Oct 2, 2020

Closing this in favor of #321

@pyup-bot pyup-bot closed this Oct 2, 2020
@idegtiarov idegtiarov deleted the pyup-update-factory-boy-2.11.1-to-3.0.1 branch October 2, 2020 21:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants