def test_010_create_libraries( self ):
     """Creating new libraries used in this script"""
     # Logged in as admin_user
     for index in range( 0, 2 ):
         name = 'library%s' % str( index + 1 )
         description = '%s description' % name
         synopsis = '%s synopsis' % name
         self.create_library( name=name, description=description, synopsis=synopsis )
     # Get the libraries for later use
     global library1
     library1 = get_library( 'library1', 'library1 description', 'library1 synopsis' )
     assert library1 is not None, 'Problem retrieving library (library1) from the database'
     global library2
     library2 = get_library( 'library2', 'library2 description', 'library2 synopsis' )
     assert library2 is not None, 'Problem retrieving library (library2) from the database'
예제 #2
0
 def test_005_create_libraries(self):
     """Testing creating libraries used in this script, then renaming one of them"""
     # Logged in as admin_user
     for index in range(0, 3):
         name = 'library%s' % str(index + 1)
         description = '%s description' % name
         synopsis = '%s synopsis' % name
         self.create_library(name=name,
                             description=description,
                             synopsis=synopsis)
         self.browse_libraries_admin(strings_displayed=[name, description])
     # Get the libraries for later use
     global library1
     library1 = get_library('library1', 'library1 description',
                            'library1 synopsis')
     assert library1 is not None, 'Problem retrieving library (library1) from the database'
     global library2
     library2 = get_library('library2', 'library2 description',
                            'library2 synopsis')
     assert library2 is not None, 'Problem retrieving library (library2) from the database'
     global library3
     library3 = get_library('library3', 'library3 description',
                            'library3 synopsis')
     assert library3 is not None, 'Problem retrieving library (library3) from the database'
     # Rename the library
     new_name = "library1 new name"
     new_description = "library1 new description"
     new_synopsis = "library1 new synopsis"
     self.library_info('library_admin',
                       self.security.encode_id(library1.id),
                       library1.name,
                       new_name=new_name,
                       new_description=new_description,
                       new_synopsis=new_synopsis)
     self.browse_libraries_admin(
         strings_displayed=[new_name, new_description])
     # Reset the library back to the original name and description
     self.library_info('library_admin',
                       self.security.encode_id(library1.id),
                       library1.name,
                       new_name='library1',
                       new_description='library1 description',
                       new_synopsis='library1 synopsis')
     refresh(library1)
 def test_010_create_libraries( self ):
     """Testing creating a new library for each template"""
     # Logged in as admin_user
     # library1 -> AddressField
     # library2 -> CheckboxField
     # library3 -> SelectField
     # library4 -> TextArea
     # library5 -> TextField
     # library6 -> WorkflowField
     for index, form in enumerate( [ AddressField_form, CheckboxField_form, SelectField_form, TextArea_form, TextField_form, WorkflowField_form ] ):
         name = 'library%s' % str( index + 1 )
         description = '%s description' % name
         synopsis = '%s synopsis' % name
         self.create_library( name=name, description=description, synopsis=synopsis )
     # Get the libraries for later use
     global library1
     library1 = get_library( 'library1', 'library1 description', 'library1 synopsis' )
     global library2
     library2 = get_library( 'library2', 'library2 description', 'library2 synopsis' )
     global library3
     library3 = get_library( 'library3', 'library3 description', 'library3 synopsis' )
     global library4
     library4 = get_library( 'library4', 'library4 description', 'library4 synopsis' )
     global library5
     library5 = get_library( 'library5', 'library5 description', 'library5 synopsis' )
     global library6
     library6 = get_library( 'library6', 'library6 description', 'library6 synopsis' )