'Testing adding a new library dataset to library3\'s folder, making sure the SelectField setting is correct on the upload form.'

def test_100_add_ldda_to_folder3(self):

    filename = '3.bed'
    ldda_message = '3.bed    message'
    self.upload_library_dataset(cntrller='library_admin', library_id=self.security.encode_id(library3.id), folder_id=self.security.encode_id(folder3.id), filename=filename, file_type='bed', dbkey='hg18', ldda_message=ldda_message, strings_displayed=['SelectField', 'selected>Option1'])
    ldda = get_latest_ldda_by_name(filename)
    assert (ldda is not None), 'Problem    retrieving    LibraryDatasetDatasetAssociation    ldda    from    the    database'
    self.browse_library(cntrller='library_admin', library_id=self.security.encode_id(library3.id), strings_displayed=[ldda.name, ldda.message, 'bed'])
    self.ldda_edit_info('library_admin', self.security.encode_id(library3.id), self.security.encode_id(folder3.id), self.security.encode_id(ldda.id), ldda.name, strings_displayed=['SelectField', 'Option1'])
    filename = '8.bed'
    self.new_history(name='import+with+SelectField')
    self.upload_file(filename)
    hda = get_latest_hda()
    self.upload_library_dataset(cntrller='library_admin', library_id=self.security.encode_id(library3.id), folder_id=self.security.encode_id(folder3.id), upload_option='import_from_history', hda_ids=self.security.encode_id(hda.id), strings_displayed=[('<select    name="%s"    last_selected_value="Option1">' % select_field_name)])
    ldda = get_latest_ldda_by_name(filename)
    assert (ldda is not None), 'Problem    retrieving    LibraryDatasetDatasetAssociation    ldda    from    the    database'
    self.browse_library(cntrller='library_admin', library_id=self.security.encode_id(library3.id), strings_displayed=[ldda.name, 'bed'])
    self.ldda_edit_info('library_admin', self.security.encode_id(library3.id), self.security.encode_id(folder3.id), self.security.encode_id(ldda.id), ldda.name, strings_displayed=['SelectField', 'Option1'])
