original_docstring: Creates an exploration and applies a state schema migration to it.
  
          Creates an exploration and migrates its state schema from version
          current_schema_version to target_schema_version. Asserts that the
          exploration was successfully migrated.
  
          Args:
              current_schema_version: string. The current schema version of the
                  exploration (eg. '29').
              target_schema_version: string. The schema version to upgrade
                  the exploration to (eg. '30').
          
docstring: Creates an exploration and applies a state schema migration to it.
  Creates an exploration and migrates its state schema from version
  current_schema_version to target_schema_version. Asserts that the
  exploration was successfully migrated.
docstring_tokens: Creates an exploration and applies a state schema migration to it . Creates an exploration and migrates its state schema from version current_schema_version to target_schema_version . Asserts that the exploration was successfully migrated .
code: def create_and_migrate_new_exploration(
              self, current_schema_version, target_schema_version):
          """Creates an exploration and applies a state schema migration to it.
  
          Creates an exploration and migrates its state schema from version
          current_schema_version to target_schema_version. Asserts that the
          exploration was successfully migrated.
  
          Args:
              current_schema_version: string. The current schema version of the
                  exploration (eg. '29').
              target_schema_version: string. The schema version to upgrade
                  the exploration to (eg. '30').
          """
  
          # Create an exploration change list with the command that will migrate
          # the schema from current_schema_version to target_schema_version.
          exp_migration_change_list = [
              exp_domain.ExplorationChange({
                  'cmd': exp_domain.CMD_MIGRATE_STATES_SCHEMA_TO_LATEST_VERSION,
                  'from_version': current_schema_version,
                  'to_version': target_schema_version
              })
          ]
  
          # The migration will automatically migrate the exploration to the latest
          # state schema version, so we set the latest schema version to be the
          # target_schema_version.
          with self.swap(
              feconf, 'CURRENT_STATE_SCHEMA_VERSION',
              int(target_schema_version)):
  
              # Create and migrate the exploration.
              self.save_new_valid_exploration(self.EXP_ID, self.USER_ID)
              exploration = exp_fetchers.get_exploration_by_id(self.EXP_ID)
              exp_services.update_exploration(
                  self.USER_ID, self.EXP_ID, exp_migration_change_list,
                  'Ran Exploration Migration job.')
  
              # Assert that the update was applied and that the exploration state
              # schema was successfully updated.
              exploration = exp_fetchers.get_exploration_by_id(self.EXP_ID)
              self.assertEqual(exploration.version, 2)
              self.assertEqual(
                  python_utils.UNICODE(
                      exploration.states_schema_version),
                  target_schema_version)
code_tokens: def create_and_migrate_new_exploration ( self , current_schema_version , target_schema_version ) : exp_migration_change_list = [ exp_domain . ExplorationChange ( { 'cmd' : exp_domain . CMD_MIGRATE_STATES_SCHEMA_TO_LATEST_VERSION , 'from_version' : current_schema_version , 'to_version' : target_schema_version } ) ] with self . swap ( feconf , 'CURRENT_STATE_SCHEMA_VERSION' , int ( target_schema_version ) ) : self . save_new_valid_exploration ( self . EXP_ID , self . USER_ID ) exploration = exp_fetchers . get_exploration_by_id ( self . EXP_ID ) exp_services . update_exploration ( self . USER_ID , self . EXP_ID , exp_migration_change_list , 'Ran Exploration Migration job.' ) exploration = exp_fetchers . get_exploration_by_id ( self . EXP_ID ) self . assertEqual ( exploration . version , 2 ) self . assertEqual ( python_utils . UNICODE ( exploration . states_schema_version ) , target_schema_version )
short_docstring: Creates an exploration and applies a state schema migration to it.
short_docstring_tokens: Creates an exploration and applies a state schema migration to it .
comment: """Creates an exploration and applies a state schema migration to it.
  
          Creates an exploration and migrates its state schema from version
          current_schema_version to target_schema_version. Asserts that the
          exploration was successfully migrated.
  
          Args:
              current_schema_version: string. The current schema version of the
                  exploration (eg. '29').
              target_schema_version: string. The schema version to upgrade
                  the exploration to (eg. '30').
          """$SEP$# Create an exploration change list with the command that will migrate$SEP$# the schema from current_schema_version to target_schema_version.$SEP$# The migration will automatically migrate the exploration to the latest$SEP$# state schema version, so we set the latest schema version to be the$SEP$# target_schema_version.$SEP$# Create and migrate the exploration.$SEP$# Assert that the update was applied and that the exploration state$SEP$# schema was successfully updated.