From a4b09344af067a6cd44615697a9a356019230422 Mon Sep 17 00:00:00 2001 From: Anthony Nemitz Date: Thu, 23 Aug 2012 18:08:12 -0700 Subject: [PATCH 1/2] test case for multiple inheritance raising MRO exception --- tests/test_document.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_document.py b/tests/test_document.py index bee6c5c6..8f28e7e5 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -365,6 +365,28 @@ class DocumentTest(unittest.TestCase): Animal.drop_collection() + def test_document_inheritance(self): + """ + + """ + class DateCreatedDocument(Document): + meta = { + 'allow_inheritance': True, + 'abstract': True, + } + + class DateUpdatedDocument(Document): + meta = { + 'allow_inheritance': True, + 'abstract': True, + } + + def create_my_document(): + class MyDocument(DateCreatedDocument, DateUpdatedDocument): + pass + + create_my_document() + def test_how_to_turn_off_inheritance(self): """Demonstrates migrating from allow_inheritance = True to False. """ From ab9e9a33294b2bcb4c6f547fb39c11e0bbc01045 Mon Sep 17 00:00:00 2001 From: Anthony Nemitz Date: Thu, 23 Aug 2012 18:09:51 -0700 Subject: [PATCH 2/2] adding comment to the MRO test case --- tests/test_document.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_document.py b/tests/test_document.py index 8f28e7e5..523ab6af 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -366,8 +366,7 @@ class DocumentTest(unittest.TestCase): Animal.drop_collection() def test_document_inheritance(self): - """ - + """Ensure mutliple inheritance of abstract docs works """ class DateCreatedDocument(Document): meta = {