Here is the method:
def get_error_url(error_message, redirect_url=None):
error_url_parts = urlparse.urlsplit(redirect_url or settings.LANDING_PAGE_URL)
error_url = urlparse.urlunsplit(
(
error_url_parts.scheme,
error_url_parts.netloc,
error_url_parts.path,
urllib.urlencode([
('error', error_message),
]),
'',
)
)
return error_url
I have no clue where to begin writing a test for something like this. It may seem simple, but I am a newb to Python. Thanks in advance for the help!