def test_override(self): """Overrides existing value in querystring.""" self.assertEqual( Url(self.func("http://fake.base/?pagesize=40&pagenumber=3", 5)), Url("http://fake.base/?pagenumber=5&pagesize=40"))
def test_override(self): """Overrides existing values in querystring, jumping back to page 1.""" self.assertEqual( Url(self.func("http://fake.base/?pagesize=40&pagenumber=3", 10)), Url("http://fake.base/?pagenumber=1&pagesize=10"))
def test_simple(self): """Adds pagenumber to a URL without it in querystring.""" self.assertEqual(Url(self.func("http://fake.base/", 3)), Url("http://fake.base/?pagenumber=3"))
def test_simple(self): """Adds pagenumber and pagesize to a URL with neither in querystring.""" self.assertEqual(Url(self.func("http://fake.base/", 10)), Url("http://fake.base/?pagenumber=1&pagesize=10"))