def test_allow_inheritance(self):

        class Animal(Document):
            name = StringField()

        def create_dog_class():
            class Dog(Animal):
                pass

        self.assertRaises(ValueError, create_dog_class)

        # Check that _cls etc aren't present on simple documents
        dog = Animal(name='dog').save()
        self.assertEqual(dog.to_mongo().keys(), ['_id', 'name'])

        collection = self.db[Animal._get_collection_name()]
        obj = collection.find_one()
        self.assertFalse('_cls' in obj)
Efficiently copy from other into this object.
dataset/ETHPy150Open MongoEngine/mongoengine/tests/document/inheritance.py/InheritanceTest.test_allow_inheritance--crossover with--dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/structs.py/RDFStruct.CopyConstructor