diff --git a/src/postorius/tests/mailman_api_tests/test_list_summary.py b/src/postorius/tests/mailman_api_tests/test_list_summary.py index 87eefc3..133de69 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_summary.py +++ b/src/postorius/tests/mailman_api_tests/test_list_summary.py @@ -120,8 +120,7 @@ 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, '
  • ', count=9) + self.assertContains(response, 'Delete List') @MM_VCR.use_cassette('test_list_summary_moderator.yaml') def test_list_summary_moderator(self): @@ -132,8 +131,8 @@ 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, '
  • ', count=3) + self.assertContains(response, 'Held Messages') + self.assertNotContains(response, 'Delete List') @MM_VCR.use_cassette('test_list_summary_secondary_owner.yaml') def test_list_summary_is_admin_secondary_owner(self): @@ -146,8 +145,7 @@ 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, '
  • ', count=9) + self.assertContains(response, 'Delete List') @MM_VCR.use_cassette('test_list_summary_secondary_moderator.yaml') def test_list_summary_is_admin_secondary_moderator(self): @@ -161,33 +159,5 @@ response = self.client.get(reverse('list_summary', args=('foo@example.com', ))) self.assertEqual(response.status_code, 200) - self.assertContains(response, '
  • ', count=3) - - @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',))) - self.assertNotContains(response, '

    List Metrics

    ') - - @MM_VCR.use_cassette('test_list_summary_metrics_moderator.yaml') - def test_list_metrics_not_displayed_to_moderator(self): - mlist = self.mmclient.get_list('foo@example.com') - 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.assertNotContains(response, '

    List Metrics

    ') - - @MM_VCR.use_cassette('test_list_summary_metrics_owner.yaml') - def test_list_metrics_displayed_to_owner(self): - mlist = self.mmclient.get_list('foo@example.com') - 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, '

    List Metrics

    ') - - @MM_VCR.use_cassette('test_list_summary_metrics_superuser.yaml') - def test_list_metrics_displayed_to_superuser(self): - mlist = self.mmclient.get_list('foo@example.com') - User.objects.create_superuser('testadminuser', 'testadmin@example.com', 'testpass') - self.assertTrue(self.client.login(username='testadminuser', password='testpass')) - response = self.client.get(reverse('list_summary', args=('foo@example.com',))) - self.assertContains(response, '

    List Metrics

    ') + self.assertContains(response, 'Held Messages') + self.assertNotContains(response, 'Delete List')