Fix the case in the tests
1 parent 4e6bd59 commit 5ad11f6c42342fa610e5ef974606b85a1d815b09
@Aurélien Bompard Aurélien Bompard authored on 9 Dec 2015
Showing 1 changed file
View
12
src/postorius/tests/mailman_api_tests/test_list_summary.py
mlist.add_owner('test@example.com')
self.client.login(username='testuser', password='testpass')
response = self.client.get(reverse('list_summary',
args=('foo@example.com', )))
self.assertContains(response, 'Delete List</a>')
self.assertContains(response, 'Delete list</a>')
 
@MM_VCR.use_cassette('test_list_summary_moderator.yaml')
def test_list_summary_moderator(self):
# Response must contain the administration menu
mlist.add_moderator('test@example.com')
self.client.login(username='testuser', password='testpass')
response = self.client.get(reverse('list_summary',
args=('foo@example.com', )))
self.assertContains(response, 'Held Messages</a>')
self.assertNotContains(response, 'Delete List</a>')
self.assertContains(response, 'Held messages</a>')
self.assertNotContains(response, 'Delete list</a>')
 
@MM_VCR.use_cassette('test_list_summary_secondary_owner.yaml')
def test_list_summary_is_admin_secondary_owner(self):
# Response must contain the administration menu
mlist.add_owner('anotheremail@example.com')
self.client.login(username='testuser', password='testpass')
response = self.client.get(reverse('list_summary',
args=('foo@example.com', )))
self.assertContains(response, 'Delete List</a>')
self.assertContains(response, 'Delete list</a>')
 
@MM_VCR.use_cassette('test_list_summary_secondary_moderator.yaml')
def test_list_summary_is_admin_secondary_moderator(self):
# Response must contain the administration menu
self.client.login(username='testuser', password='testpass')
response = self.client.get(reverse('list_summary',
args=('foo@example.com', )))
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'Held Messages</a>')
self.assertNotContains(response, 'Delete List</a>')
self.assertContains(response, 'Held messages</a>')
self.assertNotContains(response, 'Delete list</a>')
 
@MM_VCR.use_cassette('test_list_summary_metrics_anonymous.yaml')
def test_metrics_not_displayed_to_anonymous(self):
response = self.client.get(reverse('list_summary', args=('foo@example.com',)))