Ticket #19327: 19327.diff

File 19327.diff, 949 bytes (added by adupin, 2 years ago)

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

  • tests/regressiontests/admin_custom_urls/tests.py

    diff --git a/tests/regressiontests/admin_custom_urls/tests.py b/tests/regressiontests/admin_custom_urls/tests.py
    index 87c72e2..6b64a1d 100644
    a b class AdminCustomUrlsTest(TestCase): 
    5858        self.assertContains(response, 'dismissAddAnotherPopup')
    5959        self.assertContains(response, 'Action added through a popup')
    6060
     61    def testDoubleLogin(self):
     62        url = '/custom_urls/admin/admin_custom_urls/action/!add/'
     63        post_data = {
     64            'username': 'super',
     65            'password': 'secret',
     66            'this_is_the_login_form': '1',
     67            'next': url
     68        }
     69        response = self.client.post(url, post_data)
     70        self.assertEqual('http://testserver' + url, response['Location'])
     71
    6172    def testAdminUrlsNoClash(self):
    6273        """
    6374        Test that some admin URLs work correctly.
Back to Top