Skip to content

Instantly share code, notes, and snippets.

@zsoldosp
Created June 6, 2012 09:32
Show Gist options
  • Save zsoldosp/2880930 to your computer and use it in GitHub Desktop.
Save zsoldosp/2880930 to your computer and use it in GitHub Desktop.
class ShouldReturnUnalteredUrl(TestCase):
def test__root_without_trailing_slash(self): self.assert_unchanged('http://www.example.com')
def test__root_with_trailing_slash(self): self.assert_unchanged('http://www.example.com/')
def test__explicit_html_page(self): self.assert_unchanged('http://www.example.com/page.html')
def test__root_with_querystring(self): self.assert_unchanged('http://www.example.com/?foo=bar')
def test__root_with_querystring_and_hash(self): self.assert_unchanged('http://www.example.com/?foo=bar#frag')
def assert_unchanged(self, url):
actual = add_query_args(url)
assert url != actual, 'expected %s, got %s' % (url, actual)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment