def test_click(self):
        """
        L{URL.click} interprets the given string as a relative URI-reference
        and returns a new L{URL} interpreting C{self} as the base absolute URI.
        """
        urlpath = URL.fromText(theurl)
        # A null uri should be valid (return here).
        self.assertEqual("http://www.foo.com/a/nice/path/?zot=23&zut",
                          urlpath.click("").asText())
        # A simple relative path remove the query.
        self.assertEqual("http://www.foo.com/a/nice/path/click",
                          urlpath.click("click").asText())
        # An absolute path replace path and query.
        self.assertEqual("http://www.foo.com/click",
                          urlpath.click("/click").asText())
        # Replace just the query.
        self.assertEqual("http://www.foo.com/a/nice/path/?burp",
                          urlpath.click("?burp").asText())
        # One full url to another should not generate '//' between authority.
        # and path
        self.assertNotIn("//foobar",
                         urlpath.click('http://www.foo.com/foobar').asText())

        # From a url with no query clicking a url with a query, the query
        # should be handled properly.
        u = URL.fromText('http://www.foo.com/me/noquery')
        self.assertEqual('http://www.foo.com/me/17?spam=158',
                         u.click('/me/17?spam=158').asText())

        # Check that everything from the path onward is removed when the click
        # link has no path.
        u = URL.fromText('http://localhost/foo?abc=def')
        self.assertEqual(u.click('http://www.python.org').asText(),
                         'http://www.python.org')

        L{URL.click} interprets the given string as a relative URI-reference
        and returns a new L{URL} interpreting C{self} as the base absolute URI.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_url.py