def test_allow_inheritance_abstract_document(self):
        class FinalDocument(Document):
            meta = {'abstract': True,
                    'allow_inheritance': False}

        class Animal(FinalDocument):
            name = StringField()

        def create_mammal_class():
            class Mammal(Animal):
                pass
        self.assertRaises(ValueError, create_mammal_class)

        # Check that _cls isn't present in simple documents
        doc = Animal(name='dog')
        self.assertFalse('_cls' in doc.to_mongo())
Ensure that abstract documents can set inheritance rules and that
dataset/ETHPy150Open MongoEngine/mongoengine/tests/document/inheritance.py/InheritanceTest.test_allow_inheritance_abstract_document