Maybe rename the ``url`` parameter to something like ``expected_url``?  And/or document the parameters in the docstring.