Merge lp:~aanand0071/postorius/postorius into lp:postorius

Proposed by Aanand
Status: Needs review
Proposed branch: lp:~aanand0071/postorius/postorius
Merge into: lp:postorius
Diff against target: 72 lines (+58/-0)
1 file modified
src/postorius/tests/mailman_api_tests/test_list_delete.py (+58/-0)
To merge this branch: bzr merge lp:~aanand0071/postorius/postorius
Reviewer Review Type Date Requested Status
Terri Needs Fixing
Review via email: mp+251907@code.launchpad.net

Description of the change

Added test_list_delete.py

To post a comment you must log in.
Revision history for this message
Terri (terriko) wrote :

I'm getting "MailmanConnectionError: Could not connect to Mailman API" when I run this test, and only this test, so I think there may be something incorrect in the config here. Can you run against the latest version of mailman and debug?

review: Needs Fixing
Revision history for this message
Terri (terriko) wrote :

Also, great thought on fixing all those permissions in the css/png/js -- if you want to submit that as a separate patch, I'd be happy to merge it while you debug the test case.

Unmerged revisions

204. By Aanand

added test_list_delete.py

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/postorius/doc/settings.py' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/css/style.css' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/img/icons/minus.png' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/img/icons/plus.png' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/img/mailman_logo.png' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/js/libs/modernizr-1.7.min.js' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/js/plugins.js' (properties changed: +x to -x)
=== modified file 'src/postorius/static/postorius/js/script.js' (properties changed: +x to -x)
=== added file 'src/postorius/tests/mailman_api_tests/test_list_delete.py'
--- src/postorius/tests/mailman_api_tests/test_list_delete.py 1970-01-01 00:00:00 +0000
+++ src/postorius/tests/mailman_api_tests/test_list_delete.py 2015-03-05 11:21:00 +0000
@@ -0,0 +1,58 @@
1from __future__ import (
2 absolute_import, division, print_function, unicode_literals)
3
4
5import six
6import logging
7
8from django.core.urlresolvers import reverse
9from django.test import Client, SimpleTestCase
10from django.test.utils import override_settings
11from urllib2 import HTTPError
12from django.contrib.auth.models import User
13from postorius.utils import get_client
14from postorius.tests import MM_VCR
15
16
17logger = logging.getLogger(__name__)
18vcr_log = logging.getLogger('vcr')
19vcr_log.setLevel(logging.WARNING)
20
21
22API_CREDENTIALS = {'MAILMAN_API_URL': 'http://localhost:9001',
23 'MAILMAN_USER': 'restadmin',
24 'MAILMAN_PASS': 'restpass'}
25
26
27@override_settings(**API_CREDENTIALS)
28class ListDeletePageTest(SimpleTestCase):
29 """Tests for the list index page."""
30
31 @MM_VCR.use_cassette('test_list_delete.yaml')
32 def setUp(self):
33 self.mm_client = get_client()
34 self.client = Client()
35 try:
36 self.domain = self.mm_client.create_domain('example.com')
37 except HTTPError:
38 self.domain = self.mm_client.get_domain('example.com')
39 self.foo_list = self.mm_client.get_list('foo@example.com')
40 self.superuser=User.objects.create_superuser('sup','sup@example.com','pswd')
41
42 @MM_VCR.use_cassette('test_list_delete.yaml')
43 def test_list_delete_contains_no_list(self):
44 self.client.login(username='sup',password='pswd')
45 response1 = self.client.get(reverse('list_delete',args=['foo@example.com']),follow=True)
46 self.assertEqual(response1.status_code,200)
47 self.client.post(revrse('list_delete',args=['foo@example.com']),follow=True)
48 self.assertRedirects(response1,reverse('list_index'),status_code=302)
49 response2=self.client.get(reverse('list_delete'))
50 self.asserEqual(len(response2.context['lists']), 0)
51
52
53
54 @MM_VCR.use_cassette('test_list_delete.yaml')
55 def tearDown(self):
56 self.superuser.delete()
57 self.client.delete_domain('example.org')
58
059
=== modified file 'testing/test_settings.py' (properties changed: +x to -x)

Subscribers

People subscribed via source and target branches