diff --git a/src/allmydata/test/web/test_web.py b/src/allmydata/test/web/test_web.py index bab8f4ea0..da0ab0f3c 100644 --- a/src/allmydata/test/web/test_web.py +++ b/src/allmydata/test/web/test_web.py @@ -4177,15 +4177,31 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi self.GET, "/uri") return d + @inlineCallbacks def test_GET_rename_form(self): - d = self.GET(self.public_url + "/foo?t=rename-form&name=bar.txt", - followRedirect=True) - def _check(res): - self.failUnless(re.search('', res), res) - self.failUnless(re.search(r'', res), res) - self.failUnlessIn(FAVICON_MARKUP, res) - d.addCallback(_check) - return d + data = yield self.GET( + self.public_url + "/foo?t=rename-form&name=bar.txt", + followRedirect=True + ) + soup = BeautifulSoup(data, 'html5lib') + assert_soup_has_favicon(self, soup) + inputs = soup.find_all(u"input") + want = [ + {u"name": u"when_done", u"value": u".", u"type": u"hidden"}, + {u"readonly": u"true", u"name": u"from_name", u"value": u"bar.txt", u"type": u"text"}, + ] + found = [] + for inp in inputs: + print(inp) + print(dir(inp)) + print(inp.attrs) + if inp.attrs in want: + found.append(inp.attrs) + self.assertEqual( + len(found), + len(want), + "Wanted tags: {} but only found: {}".format(want, found), + ) def log(self, res, msg): #print "MSG: %s RES: %s" % (msg, res)