def test_0110_delete_filtering_repository( self ):
     '''Delete the filtering_0000 repository and verify that it no longer has any downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     self.logout()
     self.login( email=common.admin_email, username=common.admin_username )
     self.delete_repository( repository )
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh( metadata_revision )
     # Marking a repository as deleted should result in no metadata revisions being downloadable.
     assert True not in [ metadata.downloadable for metadata in repository.metadata_revisions ]
 def test_0115_undelete_filtering_repository( self ):
     '''Undelete the filtering_0000 repository and verify that it now has two downloadable revisions.'''
     repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
     self.logout()
     self.login( email=common.admin_email, username=common.admin_username )
     self.undelete_repository( repository )
     # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
     for metadata_revision in repository.metadata_revisions:
         test_db_util.refresh( metadata_revision )
     # Marking a repository as undeleted should result in all previously downloadable metadata revisions being downloadable again.
     # In this case, there should be two downloadable revisions, one for filtering 1.1.0 and one for filtering 2.2.0.
     assert True in [ metadata.downloadable for metadata in repository.metadata_revisions ]
     assert len( repository.downloadable_revisions ) == 2