Mercurial > p > roundup > code
diff test/test_templating.py @ 4040:b6a2251394dd
Make cgi.templating more fault-tolerant towards invalid requests.
| author | Stefan Seefeld <stefan@seefeld.name> |
|---|---|
| date | Mon, 16 Feb 2009 21:02:23 +0000 |
| parents | e77bcbdc9b32 |
| children | ce684080e968 |
line wrap: on
line diff
--- a/test/test_templating.py Mon Feb 16 20:53:40 2009 +0000 +++ b/test/test_templating.py Mon Feb 16 21:02:23 2009 +0000 @@ -72,6 +72,22 @@ class HTMLClassTestCase(TemplatingTestCase) : + def test_link(self): + """Make sure lookup of a Link property works even in the + presence of multiple values in the form.""" + def lookup(key) : + self.assertEqual(key, key.strip()) + return "Status%s"%key + self.form.list.append(MiniFieldStorage("status", "1")) + self.form.list.append(MiniFieldStorage("status", "2")) + status = hyperdb.Link("status") + self.client.db.classes = dict \ + ( issue = MockNull(getprops = lambda : dict(status = status)) + , status = MockNull(get = lambda id, name : id, lookup = lookup) + ) + cls = HTMLClass(self.client, "issue") + cls["status"] + def test_multilink(self): """`lookup` of an item will fail if leading or trailing whitespace has not been stripped.
