Aanand has proposed merging lp:~aanand0071/postorius/postorius into
lp:postorius.
Requested reviews:
Mailman Coders (mailman-coders)
For more details, see:
https://code.launchpad.net/~aanand0071/postorius/postorius/+merge/251907
Added test_list_delete.py
--
Your team Mailman Coders is requested to review the proposed merge of
lp:~aanand0071/postorius/postorius into lp:postorius.
=== 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 @@
+from __future__ import (
+ absolute_import, division, print_function, unicode_literals)
+
+
+import six
+import logging
+
+from django.core.urlresolvers import reverse
+from django.test import Client, SimpleTestCase
+from django.test.utils import override_settings
+from urllib2 import HTTPError
+from django.contrib.auth.models import User
+from postorius.utils import get_client
+from postorius.tests import MM_VCR
+
+
+logger = logging.getLogger(__name__)
+vcr_log = logging.getLogger('vcr')
+vcr_log.setLevel(logging.WARNING)
+
+
+API_CREDENTIALS = {'MAILMAN_API_URL': 'http://localhost:9001',
+ 'MAILMAN_USER': 'restadmin',
+ 'MAILMAN_PASS': 'restpass'}
+
+
+@override_settings(**API_CREDENTIALS)
+class ListDeletePageTest(SimpleTestCase):
+ """Tests for the list index page."""
+
+ @MM_VCR.use_cassette('test_list_delete.yaml')
+ def setUp(self):
+ self.mm_client = get_client()
+ self.client = Client()
+ try:
+ self.domain = self.mm_client.create_domain('example.com')
+ except HTTPError:
+ self.domain = self.mm_client.get_domain('example.com')
+ self.foo_list = self.mm_client.get_list('[email protected]')
+ self.superuser=User.objects.create_superuser('sup','[email protected]','pswd')
+
+ @MM_VCR.use_cassette('test_list_delete.yaml')
+ def test_list_delete_contains_no_list(self):
+ self.client.login(username='sup',password='pswd')
+ response1 = self.client.get(reverse('list_delete',args=['[email protected]']),follow=True)
+ self.assertEqual(response1.status_code,200)
+ self.client.post(revrse('list_delete',args=['[email protected]']),follow=True)
+ self.assertRedirects(response1,reverse('list_index'),status_code=302)
+ response2=self.client.get(reverse('list_delete'))
+ self.asserEqual(len(response2.context['lists']), 0)
+
+
+
+ @MM_VCR.use_cassette('test_list_delete.yaml')
+ def tearDown(self):
+ self.superuser.delete()
+ self.client.delete_domain('example.org')
+
=== modified file 'testing/test_settings.py' (properties changed: +x to -x)
_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders