Fix deepcopy on EmbeddedDocument
This commit is contained in:
committed by
Bastien Gerard
parent
3b10236b5e
commit
88642eb021
@@ -3,6 +3,7 @@ import pickle
|
||||
import unittest
|
||||
import uuid
|
||||
import weakref
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
|
||||
import bson
|
||||
@@ -78,6 +79,14 @@ class TestDocumentInstance(MongoDBTestCase):
|
||||
else:
|
||||
assert field._instance == instance
|
||||
|
||||
def test_deepcopy(self):
|
||||
"""Ensure that the _instance attribute on EmbeddedDocument exists after a deepcopy"""
|
||||
|
||||
doc = self.Job()
|
||||
assert doc._instance is None
|
||||
copied = deepcopy(doc)
|
||||
assert copied._instance is None
|
||||
|
||||
def test_capped_collection(self):
|
||||
"""Ensure that capped collections work properly."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user