def test_how_to_convert_to_the_new_inheritance_model(self):
        """Demonstrates migrating from 0.7 to 0.8
        """

        # 1. Declaration of the class
        class Animal(Document):
            name = StringField()
            meta = {
                'allow_inheritance': True,
                'indexes': ['name']
            }

        # 2. Remove _types
        collection = Animal._get_collection()
        collection.update({}, {"$unset": {"_types": 1}}, multi=True)

        # 3. Confirm extra data is removed
        count = collection.find({'_types': {"$exists": True}}).count()
        self.assertEqual(0, count)

        # 4. Remove indexes
        info = collection.index_information()
        indexes_to_drop = [key for key, value in info.iteritems()
                           if dict(value['key']) in '_types']
        for index in indexes_to_drop:
            collection.drop_index(index)

        # 5. Recreate indexes
        Animal.ensure_indexes()
dataset/ETHPy150Open MongoEngine/mongoengine/tests/migration/convert_to_new_inheritance_model.py/ConvertToNewInheritanceModel.test_how_to_convert_to_the_new_inheritance_model/swapped operands of `in`