Merge branch 'master' of https://github.com/elasticsales/mongoengine
This commit is contained in:
commit
03beb6852a
1 changed files with 21 additions and 0 deletions
|
|
@ -365,6 +365,27 @@ class DocumentTest(unittest.TestCase):
|
||||||
|
|
||||||
Animal.drop_collection()
|
Animal.drop_collection()
|
||||||
|
|
||||||
|
def test_document_inheritance(self):
|
||||||
|
"""Ensure mutliple inheritance of abstract docs works
|
||||||
|
"""
|
||||||
|
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):
|
def test_how_to_turn_off_inheritance(self):
|
||||||
"""Demonstrates migrating from allow_inheritance = True to False.
|
"""Demonstrates migrating from allow_inheritance = True to False.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue