Code

Ticket #19327: 19327.diff

File 19327.diff, 949 bytes (added by adupin, 20 months ago)

Test for KJ's patch. Should the message be tested, too?

Line 
1diff --git a/tests/regressiontests/admin_custom_urls/tests.py b/tests/regressiontests/admin_custom_urls/tests.py
2index 87c72e2..6b64a1d 100644
3--- a/tests/regressiontests/admin_custom_urls/tests.py
4+++ b/tests/regressiontests/admin_custom_urls/tests.py
5@@ -58,6 +58,17 @@ class AdminCustomUrlsTest(TestCase):
6         self.assertContains(response, 'dismissAddAnotherPopup')
7         self.assertContains(response, 'Action added through a popup')
8 
9+    def testDoubleLogin(self):
10+        url = '/custom_urls/admin/admin_custom_urls/action/!add/'
11+        post_data = {
12+            'username': 'super',
13+            'password': 'secret',
14+            'this_is_the_login_form': '1',
15+            'next': url
16+        }
17+        response = self.client.post(url, post_data)
18+        self.assertEqual('http://testserver' + url, response['Location'])
19+
20     def testAdminUrlsNoClash(self):
21         """
22         Test that some admin URLs work correctly.