def test_shortener_delete(self): s = test_shortener.make_fresh("foo.hasb.ug", owner=hasbug.user.octocat_dict["url"]) hasbug.coweb.app.r.add_shortener(s) with self.app as c: self.login_as_octocat() resp = self.app.delete("/s/" + s.host, headers={"x-hasbug-canary": flask.session["canary"]}) self.assertTrue("200" in resp.status)
def test_show_shorten_unknown(self): hasbug.coweb.app.r.add_shortener(test_shortener.make_fresh("foo.hasb.ug")) resp = self.app.get("/aka/http://google.com/") self.assertTrue("200" in resp.status)
def test_show_shorten(self): hasbug.coweb.app.r.add_shortener(test_shortener.make_fresh("foo.hasb.ug")) resp = self.app.get("/aka/http://foo.bugtracker.org/12345") self.assertTrue("200" in resp.status)
def test_shortener_show(self): s = test_shortener.make_fresh("foo.hasb.ug") hasbug.coweb.app.r.add_shortener(s) resp = self.app.get("/s/" + s.host) self.assert_redirect_to(resp, "http://foo.hasb.ug/")