'Test pretty, sequential filenames when journalist deletes files'

def test_filenames_delete(self):

    self.source_app.get('/generate')
    self.source_app.post('/create')
    self.helper_filenames_submit()
    resp = self.journalist_app.get('/')
    soup = BeautifulSoup(resp.data, 'html.parser')
    first_col_url = soup.select('ul#cols    >    li    a')[0]['href']
    resp = self.journalist_app.get(first_col_url)
    self.assertEqual(resp.status_code, 200)
    soup = BeautifulSoup(resp.data, 'html.parser')
    self.helper_filenames_delete(soup, 1)
    resp = self.journalist_app.get(first_col_url)
    soup = BeautifulSoup(resp.data, 'html.parser')
    submission_filename_re = '^{0}-[a-z0-9-_]+(-msg|-doc\\.gz)\\.gpg$'
    filename = str(soup.select('ul#submissions    li    a    .filename')[0].contents[0])
    self.assertTrue(re.match(submission_filename_re.format(1), filename))
    filename = str(soup.select('ul#submissions    li    a    .filename')[1].contents[0])
    self.assertTrue(re.match(submission_filename_re.format(3), filename))
    filename = str(soup.select('ul#submissions    li    a    .filename')[2].contents[0])
    self.assertTrue(re.match(submission_filename_re.format(4), filename))
