summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:26:52 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-10-20 23:26:52 +0200
commitdc7d02095fff8124aaeccf8f08958fa6797b6ce6 (patch)
tree01a710ec87d3821cfef76786bad702175a233357
parent1e1adebe92397b405563dc141c853f62feca6c82 (diff)
downloadfactory-boy-dc7d02095fff8124aaeccf8f08958fa6797b6ce6.tar
factory-boy-dc7d02095fff8124aaeccf8f08958fa6797b6ce6.tar.gz
mogo: Stop using deprecated .new (Closes #219)
This method has been deprecated in `mogo.model.Model` since 2012. Thanks to @federicobond for spotting this!
-rw-r--r--docs/changelog.rst1
-rw-r--r--factory/mogo.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 24c01aa..d38c06a 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -22,6 +22,7 @@ ChangeLog
- :issue:`201`: Properly handle custom Django managers when dealing with abstract Django models.
- :issue:`212`: Fix :meth:`factory.django.mute_signals` to handle Django's signal caching
- :issue:`228`: Don't load :func:`django.apps.apps.get_model()` until required
+ - :issue:`219`: Stop using :meth:`mogo.model.Model.new()`, deprecated 4 years ago.
.. _v2.5.2:
diff --git a/factory/mogo.py b/factory/mogo.py
index c6c3c19..b5841b1 100644
--- a/factory/mogo.py
+++ b/factory/mogo.py
@@ -37,7 +37,7 @@ class MogoFactory(base.Factory):
@classmethod
def _build(cls, model_class, *args, **kwargs):
- return model_class.new(*args, **kwargs)
+ return model_class(*args, **kwargs)
@classmethod
def _create(cls, model_class, *args, **kwargs):