'Test the "delete selected" checkboxes on the index page that can be
used to delete multiple collections'

def test_delete_collections(self):

    num_sources = 2
    for i in range(num_sources):
        self.source_app.get('/generate')
        self.source_app.post('/create')
        self.source_app.post('/submit', data=dict(msg=(('This    is    a    test    ' + str(i)) + '.'), fh=(StringIO(''), '')), follow_redirects=True)
        self.source_app.get('/logout')
    resp = self.journalist_app.get('/')
    soup = BeautifulSoup(resp.data, 'html.parser')
    checkbox_values = [checkbox['value'] for checkbox in soup.select('input[name="cols_selected"]')]
    resp = self.journalist_app.post('/col/process', data=dict(action='delete', cols_selected=checkbox_values), follow_redirects=True)
    self.assertEqual(resp.status_code, 200)
    self.assertIn(('%s    collections    deleted' % (num_sources,)), resp.data)
    utils.async.wait_for_assertion((lambda : self.assertFalse(any([os.path.exists(store.path(sid)) for sid in checkbox_values]))))
