'Test that the schema is set in each document'

def test_schema(self):

    db_connection = modulestore().db_connection
    for collection in [db_connection.course_index, db_connection.structures, db_connection.definitions]:
        self.assertEqual(collection.find({'schema_version': {'$exists': False}}).count(), 0, '{0.name}    has    records    without    schema_version'.format(collection))
        self.assertEqual(collection.find({'schema_version': {'$ne': SplitMongoModuleStore.SCHEMA_VERSION}}).count(), 0, '{0.name}    has    records    with    wrong    schema_version'.format(collection))
