diff --git a/docs/changelog.rst b/docs/changelog.rst index 63982cc7..85cffbce 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,7 @@ Development - Calling `connect` 2 times with the same alias and different parameter will raise an error (should call `disconnect` first). - `disconnect` now clears `mongoengine.connection._connection_settings`. - `disconnect` now clears the cached attribute `Document._collection`. +- BREAKING CHANGE: `EmbeddedDocument.save` & `.reload` is no longier exist #1552 - (Fill this out as you fix issues and develop your features). Changes in 0.17.0 diff --git a/mongoengine/document.py b/mongoengine/document.py index bf194c70..341a41ba 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -90,18 +90,6 @@ class EmbeddedDocument(six.with_metaclass(DocumentMetaclass, BaseDocument)): return data - def save(self, *args, **kwargs): - warnings.warn("EmbeddedDocument.save is deprecated and will be removed in a next version of mongoengine." - "Use the parent document's .save() or ._instance.save()", - DeprecationWarning, stacklevel=2) - self._instance.save(*args, **kwargs) - - def reload(self, *args, **kwargs): - warnings.warn("EmbeddedDocument.reload is deprecated and will be removed in a next version of mongoengine." - "Use the parent document's .reload() or ._instance.reload()", - DeprecationWarning, stacklevel=2) - self._instance.reload(*args, **kwargs) - class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)): """The base class used for defining the structure and properties of diff --git a/tests/document/instance.py b/tests/document/instance.py index 2fa75538..3a2f7fcd 100644 --- a/tests/document/instance.py +++ b/tests/document/instance.py @@ -3189,24 +3189,6 @@ class InstanceTest(MongoDBTestCase): "UNDEFINED", system.nodes["node"].parameters["param"].macros["test"].value) - def test_embedded_document_save_reload_warning(self): - """Relates to #1570""" - class Embedded(EmbeddedDocument): - pass - - class Doc(Document): - emb = EmbeddedDocumentField(Embedded) - - doc = Doc(emb=Embedded()).save() - doc.emb.save() # Make sure its still working - with warnings.catch_warnings(): - warnings.simplefilter("error", DeprecationWarning) - with self.assertRaises(DeprecationWarning): - doc.emb.save() - - with self.assertRaises(DeprecationWarning): - doc.emb.reload() - def test_embedded_document_equality(self): class Test(Document): field = StringField(required=True)