Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • G gesfipe
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 35
    • Merge requests 35
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Prog
  • gesfipe
  • Merge requests
  • !581

Open
Created Aug 18, 2024 by Prog@ProgMaintainer
  • Report abuse
Report abuse

Update factory-boy to 3.3.1

  • Overview 0
  • Commits 1
  • Changes 1

Created by: pyup-bot

This PR updates factory-boy from 2.10.0 to 3.3.1.

Changelog

3.3.1

------------------
*New:*

- Add support for Django 4.2
- Add support for Django 5.1
- Add support for Python 3.12
- :issue:`903`: Add basic typing annotations
- Run the test suite against ``mongomock`` instead of an actual MongoDB server

*Bugfix:*

- :issue:`1031`: Do not require :attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session` when
:attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session_factory` is provided.

*Removed:*

- Stop advertising and verifying support for Django 3.2, 4.0, 4.1

3.3.0

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

*New:*

 - :issue:`366`: Add :class:`factory.django.Password` to generate Django :class:`~django.contrib.auth.models.User`
   passwords.
 - :issue:`304`: Add :attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session_factory` to dynamically
   create sessions for use by the :class:`~factory.alchemy.SQLAlchemyModelFactory`.
 - Add support for Django 4.0
 - Add support for Django 4.1
 - Add support for Python 3.10
 - Add support for Python 3.11

*Bugfix:*

 - Make :meth:`~factory.django.mute_signals` mute signals during post-generation.

 - :issue:`775`: Change the signature for :class:`~factory.alchemy.SQLAlchemyModelFactory`'s ``_save`` and
   ``_get_or_create`` methods to avoid argument names clashes with a field named ``session``.

*Deprecated:*

 - :class:`~factory.django.DjangoModelFactory` will stop issuing a second call to
   :meth:`~django.db.models.Model.save` on the created instance when :ref:`post-generation-hooks` return a value.

   To help with the transition, :class:`factory.django.DjangoModelFactory`'s ``_after_postgeneration`` raises a
   :class:`DeprecationWarning` when calling :meth:`~django.db.models.Model.save`. Inspect your
   :class:`~factory.django.DjangoModelFactory` subclasses:

   - If the :meth:`~django.db.models.Model.save` call is not needed after :class:`~factory.PostGeneration`, set
     :attr:`factory.django.DjangoOptions.skip_postgeneration_save` to ``True`` in the factory meta.

   - Otherwise, the instance has been modified by :class:`~factory.PostGeneration` hooks and needs to be
     :meth:`~django.db.models.Model.save`\ d. Either:

       - call :meth:`django.db.models.Model.save` in the :class:`~factory.PostGeneration` hook that modifies the
         instance, or
       - override the :class:`~factory.Factory._after_postgeneration` method to
         :meth:`~django.db.models.Model.save` the instance.

*Removed:*

 - Drop support for Django 2.2
 - Drop support for Django 3.0
 - Drop support for Django 3.1
 - Drop support for Python 3.6
 - Drop support for Python 3.7

3.2.1

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

*New:*
 - Add support for Django 3.2

*Bugfix:*

 - Do not override signals receivers registered in a :meth:`~factory.django.mute_signals` context.

 - :issue:`775`: Change the signature for :class:`~factory.alchemy.SQLAlchemyModelFactory`'s ``_save`` and
   ``_get_or_create`` methods to avoid argument names clashes with a field named ``session``.

3.2.0

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

*New:*

 - Add support for Django 3.1
 - Add support for Python 3.9

*Removed:*

 - Drop support for Django 1.11. This version `is not maintained anymore <https://www.djangoproject.com/download/#supported-versions>`__.
 - Drop support for Python 3.5. This version `is not maintained anymore <https://devguide.python.org/developer-workflow/development-cycle/index.html#end-of-life-branches>`__.

*Deprecated:*

 - :func:`factory.use_strategy`. Use :attr:`factory.FactoryOptions.strategy` instead.
   The purpose of :func:`~factory.use_strategy` duplicates the factory option. Follow :pep:`20`: *There should be
   one-- and preferably only one --obvious way to do it.*

   :func:`~factory.use_strategy()` will be removed in the next major version.

*Bug fix:*

 - :issue:`785` :issue:`786` :issue:`787` :issue:`788` :issue:`790` :issue:`796`: Calls to :class:`factory.Faker`
   and :class:`factory.django.FileField` within a :class:`~factory.Trait` or :class:`~factory.Maybe` no longer lead to
   a ``KeyError`` crash.

3.1.0

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

*New:*

 - Allow all types of declarations in :class:`factory.Faker` calls - enables references to other faker-defined attributes.

3.0.1

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

*Bug fix:*

 - :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/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.

2.12.0

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

*New:*

 - Add support for Python 3.7
 - Add support for Django 2.1
 - Add ``getter`` to :class:`~factory.fuzzy.FuzzyChoice` that mimics
   the behavior of ``getter`` in :class:`~factory.Iterator`
 - Make the ``extra_kwargs`` parameter of :class:`~factory.Faker`'s ``generate`` method 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` keyword-only

*Bug fix:*

 - 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>`

2.11.1

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

*Bug fix:*

 - Fix passing deep context to a :class:`~factory.SubFactory` (``Foo(x__y__z=factory.Faker('name')``)

2.11.0

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

*Bug fix:*

 - Fix :class:`~factory.fuzzy.FuzzyFloat` to return a 15 decimal digits precision float by default
 - :issue:`451`: Restore :class:`~factory.django.FileField` to a
   ``factory.declarations.ParameteredAttribute``, relying on composition to parse the provided parameters.
 - :issue:`389`: Fix random state management with ``faker``.
 - :issue:`466`: Restore mixing :class:`~factory.Trait` and :meth:`~factory.post_generation`.
Links
  • PyPI: https://pypi.org/project/factory-boy
  • Changelog: https://data.safetycli.com/changelogs/factory-boy/
  • Repo: https://github.com/FactoryBoy/factory_boy
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: pyup-update-factory-boy-2.10.0-to-3.3.1