def test_hijack_urls(self): self.assertEqual('/hijack/disable-hijack-warning/', reverse('hijack:disable_hijack_warning')) self.assertEqual('/hijack/release-hijack/', reverse('hijack:release_hijack')) self.assertEqual('/hijack/1/', reverse('hijack:login_with_id', args=[1])) self.assertEqual( '/hijack/2/', reverse('hijack:login_with_id', kwargs={'user_id': 2})) self.assertEqual('/hijack/username/bob/', reverse('hijack:login_with_username', args=['bob'])) self.assertEqual( '/hijack/username/bob_too/', reverse('hijack:login_with_username', kwargs={'username': '******'})) self.assertEqual( '/hijack/email/[email protected]/', unquote_plus( reverse('hijack:login_with_email', args=['*****@*****.**']))) self.assertEqual( '/hijack/email/[email protected]/', unquote_plus( reverse('hijack:login_with_email', kwargs={'email': '*****@*****.**'})))
def test_hijack_urls(self): self.assertEqual('/hijack/disable-hijack-warning/', reverse('disable_hijack_warning')) self.assertEqual('/hijack/release-hijack/', reverse('release_hijack')) self.assertEqual('/hijack/1/', reverse('login_with_id', args=[1])) self.assertEqual('/hijack/2/', reverse('login_with_id', kwargs={'user_id': 2})) self.assertEqual('/hijack/username/bob/', reverse('login_with_username', args=['bob'])) self.assertEqual('/hijack/username/bob_too/', reverse('login_with_username', kwargs={'username': '******'})) self.assertEqual('/hijack/email/[email protected]/', unquote_plus(reverse('login_with_email', args=['*****@*****.**']))) self.assertEqual('/hijack/email/[email protected]/', unquote_plus(reverse('login_with_email', kwargs={'email': '*****@*****.**'})))
def test_hijack_urls(self): self.assertEqual("/hijack/disable-hijack-warning/", reverse("disable_hijack_warning")) self.assertEqual("/hijack/release-hijack/", reverse("release_hijack")) self.assertEqual("/hijack/1/", reverse("login_with_id", args=[1])) self.assertEqual("/hijack/2/", reverse("login_with_id", kwargs={"user_id": 2})) self.assertEqual("/hijack/username/bob/", reverse("login_with_username", args=["bob"])) self.assertEqual("/hijack/username/bob_too/", reverse("login_with_username", kwargs={"username": "******"})) self.assertEqual( "/hijack/email/[email protected]/", unquote_plus(reverse("login_with_email", args=["*****@*****.**"])), ) self.assertEqual( "/hijack/email/[email protected]/", unquote_plus(reverse("login_with_email", kwargs={"email": "*****@*****.**"})), )
def __init__(self, host, *a, **kw): HTTPConnection.__init__(self, 'localhost', *a, **kw) self.unix_path = unquote_plus(host.split(':', 1)[0])