diff --git a/src/postorius/tests/mailman_api_tests/test_domain_new.py b/src/postorius/tests/mailman_api_tests/test_domain_new.py index 551b398..6b0ca62 100644 --- a/src/postorius/tests/mailman_api_tests/test_domain_new.py +++ b/src/postorius/tests/mailman_api_tests/test_domain_new.py @@ -22,7 +22,6 @@ from django.core.urlresolvers import reverse from django.shortcuts import resolve_url from django.test import Client, TestCase -from django.test.utils import override_settings try: from urllib2 import HTTPError @@ -56,7 +55,6 @@ except HTTPError: pass - @override_settings(ROOT_URLCONF='testing.urls') def test_permission_denied(self): self.client.login(username='user', password='pwd') response = self.client.get(reverse('domain_new')) diff --git a/src/postorius/tests/mailman_api_tests/test_list_members.py b/src/postorius/tests/mailman_api_tests/test_list_members.py index 5b332fd..c10c38d 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_members.py +++ b/src/postorius/tests/mailman_api_tests/test_list_members.py @@ -22,7 +22,6 @@ from django.core.urlresolvers import reverse from django.utils.timezone import now from django.test import Client, TestCase -from django.test.utils import override_settings from six.moves.urllib_error import HTTPError from six.moves.urllib_parse import quote @@ -68,7 +67,6 @@ get_client().delete_domain('example.com') @MM_VCR.use_cassette('list_members_access.yaml') - @override_settings(ROOT_URLCONF='testing.urls') def test_page_not_accessible_if_not_logged_in(self): url = reverse('list_members', args=('foo@example.com', 'subscriber',)) response = self.client.get(url) diff --git a/src/postorius/tests/mailman_api_tests/test_list_new.py b/src/postorius/tests/mailman_api_tests/test_list_new.py index c696a6c..1be5928 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_new.py +++ b/src/postorius/tests/mailman_api_tests/test_list_new.py @@ -22,7 +22,6 @@ from django.core.urlresolvers import reverse from django.shortcuts import resolve_url from django.test import Client, TestCase -from django.test.utils import override_settings try: from urllib2 import HTTPError @@ -55,7 +54,6 @@ mlist.delete() get_client().delete_domain('example.com') - @override_settings(ROOT_URLCONF='testing.urls') def test_permission_denied(self): self.client.login(username='user', password='pwd') response = self.client.get(reverse('list_new')) diff --git a/src/postorius/tests/mailman_api_tests/test_list_settings.py b/src/postorius/tests/mailman_api_tests/test_list_settings.py index 0e6f0fc..0727a80 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_settings.py +++ b/src/postorius/tests/mailman_api_tests/test_list_settings.py @@ -78,10 +78,7 @@ expected_redirect = 'http://testserver%s?next=%s' % ( reverse(settings.LOGIN_URL), url) - # TODO Fix when dropping persona - #self.assertRedirects(response, '{}?next={}'.format(reverse(settings.LOGIN_URL), url)) - self.assertEqual(response.status_code, 302) - self.assertIn(response['location'], expected_redirect) + self.assertRedirects(response, '{}?next={}'.format(reverse(settings.LOGIN_URL), url)) @MM_VCR.use_cassette('list_settings_access.yaml') def test_page_not_accessible_if_not_logged_in(self): diff --git a/src/postorius/tests/mailman_api_tests/test_user.py b/src/postorius/tests/mailman_api_tests/test_user.py index 7815503..74f0778 100644 --- a/src/postorius/tests/mailman_api_tests/test_user.py +++ b/src/postorius/tests/mailman_api_tests/test_user.py @@ -63,10 +63,7 @@ url = quote(url) expected_redirect = 'http://testserver%s?next=%s' % ( reverse(settings.LOGIN_URL), url) - # TODO fix when dropping persona - # self.assertRedirects(response, '{}?next={}'.format(reverse(settings.LOGIN_URL), url)) - self.assertEqual(response.status_code, 302) - self.assertIn(response['location'], expected_redirect) + self.assertRedirects(response, '{}?next={}'.format(reverse(settings.LOGIN_URL), url)) @MM_VCR.use_cassette('mailman_user_access.yaml') def test_page_not_accessible_if_not_logged_in(self): diff --git a/testing/test_settings.py b/testing/test_settings.py index 78cb96e..e16132c 100755 --- a/testing/test_settings.py +++ b/testing/test_settings.py @@ -132,7 +132,7 @@ # Set `postorius.urls` as main url config if postorius # is the only app you want to serve. -ROOT_URLCONF = 'postorius.urls' +ROOT_URLCONF = 'testing.urls' TEMPLATE_DIRS = ( # uncomment if you like to overwrite the default templates: