Mercurial > p > roundup > code
diff test/test_templating.py @ 4391:d5239335fae3
make URL detection a little smarter about brackets per issue2550657
(thanks Ezio Melotti)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 12 Jul 2010 04:14:02 +0000 |
| parents | ce684080e968 |
| children | 66603a9051f9 |
line wrap: on
line diff
--- a/test/test_templating.py Mon Jul 12 04:11:05 2010 +0000 +++ b/test/test_templating.py Mon Jul 12 04:14:02 2010 +0000 @@ -147,10 +147,24 @@ p = StringHTMLProperty(self.client, 'test', '1', None, 'test', '') def t(s): return p.hyper_re.sub(p._hyper_repl, s) ae = self.assertEquals - ae(t('http://roundup.net/'), '<a href="http://roundup.net/">http://roundup.net/</a>') - ae(t('<HTTP://roundup.net/>'), '<<a href="HTTP://roundup.net/">HTTP://roundup.net/</a>>') - ae(t('<www.roundup.net>'), '<<a href="http://www.roundup.net">www.roundup.net</a>>') ae(t('item123123123123'), 'item123123123123') + ae(t('http://roundup.net/'), + '<a href="http://roundup.net/">http://roundup.net/</a>') + ae(t('<HTTP://roundup.net/>'), + '<<a href="HTTP://roundup.net/">HTTP://roundup.net/</a>>') + ae(t('<www.roundup.net>'), + '<<a href="http://www.roundup.net">www.roundup.net</a>>') + ae(t('(www.roundup.net)'), + '(<a href="http://www.roundup.net">www.roundup.net</a>)') + ae(t('foo http://msdn.microsoft.com/en-us/library/ms741540(VS.85).aspx bar'), + 'foo <a href="http://msdn.microsoft.com/en-us/library/ms741540(VS.85).aspx">' + 'http://msdn.microsoft.com/en-us/library/ms741540(VS.85).aspx</a> bar') + ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language))'), + '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">' + 'http://en.wikipedia.org/wiki/Python_(programming_language)</a>)') + ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language)).'), + '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">' + 'http://en.wikipedia.org/wiki/Python_(programming_language)</a>).') ''' class HTMLPermissions:
