Code

Ticket #19099: 19099-failing-test-case.diff

File 19099-failing-test-case.diff, 1.1 KB (added by aaugustin, 21 months ago)
Line 
1diff --git a/tests/regressiontests/i18n/patterns/tests.py b/tests/regressiontests/i18n/patterns/tests.py
2index 73c9f56..65914e8 100644
3--- a/tests/regressiontests/i18n/patterns/tests.py
4+++ b/tests/regressiontests/i18n/patterns/tests.py
5@@ -3,6 +3,7 @@ from __future__ import unicode_literals
6 import os
7 
8 from django.core.exceptions import ImproperlyConfigured
9+from django.core import mail
10 from django.core.urlresolvers import reverse, clear_url_caches
11 from django.test import TestCase
12 from django.test.utils import override_settings
13@@ -169,6 +170,13 @@ class URLRedirectTests(URLTestCaseBase):
14         response = self.client.get(response['location'])
15         self.assertEqual(response.status_code, 200)
16 
17+    @override_settings(SEND_BROKEN_LINK_EMAILS=True)
18+    def test_no_broken_link_email_on_redirect(self):
19+        response = self.client.get('/account/register/', HTTP_ACCEPT_LANGUAGE='en',
20+            HTTP_REFERER='/another/url/')
21+        self.assertRedirects(response, '/en/account/register/')
22+        self.assertEqual(len(mail.outbox), 0)
23+
24 
25 class URLRedirectWithoutTrailingSlashTests(URLTestCaseBase):
26     """