Merge pull request #1570 from erdenezul/remove_save_embedded

EmbeddedDocument should not have save method #1552
This commit is contained in:
erdenezul
2019-06-11 16:15:53 +02:00
committed by GitHub
3 changed files with 1 additions and 30 deletions

View File

@@ -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)