Check that two arguments are equivalent URLs. Ignores the order of query arguments.
(self, first, second, msg=None)
| 23 | |
| 24 | class TestCase(unittest.TestCase): |
| 25 | def assertURLEqual(self, first, second, msg=None): |
| 26 | """Check that two arguments are equivalent URLs. Ignores the order of |
| 27 | query arguments. |
| 28 | """ |
| 29 | first_parsed = urlparse(first) |
| 30 | second_parsed = urlparse(second) |
| 31 | self.assertEqual(first_parsed[:3], second_parsed[:3], msg) |
| 32 | |
| 33 | first_qsl = sorted(parse_qsl(first_parsed.query)) |
| 34 | second_qsl = sorted(parse_qsl(second_parsed.query)) |
| 35 | self.assertEqual(first_qsl, second_qsl, msg) |
| 36 | |
| 37 | def u(self, string): |
| 38 | """Create a unicode string, compatible across all versions of Python.""" |
no outgoing calls