def test_dbref(self):
student = self.Student()
with pytest.raises(exceptions.NotCreatedError):
student.dbref
# Fake document creation
student.id = ObjectId('573b352e13adf20d13d01523')
student.is_created = True
student.clear_modified()
assert student.dbref == DBRef(collection='student',
id=ObjectId('573b352e13adf20d13d01523'))
评论列表
文章目录