def test_short_list_id(self): """Some mailing lists have List-Id headers in short formats, where it is only the list ID itself (without enclosing angle-brackets). """ email = MIMEText('') email['List-Id'] = self.project.listid project = find_project_by_header(email) self.assertEqual(project, self.project)
def test_long_list_id(self): email = MIMEText('') email['List-Id'] = 'Test text <%s>' % self.project.listid project = find_project_by_header(email) self.assertEqual(project, self.project)
def test_substring_list_id(self): email = MIMEText('') email['List-Id'] = 'example.com' project = find_project_by_header(email) self.assertEqual(project, None)
def test_whitespace_list_id(self): email = MIMEText('') email['List-Id'] = ' ' project = find_project_by_header(email) self.assertEqual(project, None)
def test_no_list_id(self): email = MIMEText('') project = find_project_by_header(email) self.assertEqual(project, None)