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 68090a7..b8d1fdc 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_new.py +++ b/src/postorius/tests/mailman_api_tests/test_list_new.py @@ -17,8 +17,10 @@ import time import logging +from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse +from django.shortcuts import resolve_url from django.test import Client, SimpleTestCase from django.test.utils import override_settings try: @@ -60,9 +62,9 @@ def test_permission_denied(self): self.client.login(username='user', password='pwd') response = self.client.get(reverse('list_new')) - self.assertEqual( - response['location'], - 'http://testserver/postorius/accounts/login/?next=/lists/new/') + expected = 'http://testserver%s?next=%s' % ( + resolve_url(settings.LOGIN_URL), reverse('list_new')) + self.assertEqual(response['location'], expected) @MM_VCR.use_cassette('test_list_creation.yaml') def test_new_list_created_with_owner(self):