Code

issue2550729: Fix password history display for anydbm backend, thanks to
[roundup.git] / test / test_templating.py
index a5803491b836abaaa321f8b80a58264e2b1f1dcd..a4c531b9257b07edc2a13332a9782c83cab17d1d 100644 (file)
@@ -146,10 +146,33 @@ class HTMLClassTestCase(TemplatingTestCase) :
     def test_url_replace(self):
         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('&lt;HTTP://roundup.net/&gt;'), '&lt;<a href="HTTP://roundup.net/">HTTP://roundup.net/</a>&gt;')
-        ae(t('&lt;www.roundup.net&gt;'), '&lt;<a href="http://www.roundup.net">www.roundup.net</a>&gt;')
+        ae = self.assertEqual
+        ae(t('item123123123123'), 'item123123123123')
+        ae(t('http://roundup.net/'),
+           '<a href="http://roundup.net/">http://roundup.net/</a>')
+        ae(t('&lt;HTTP://roundup.net/&gt;'),
+           '&lt;<a href="HTTP://roundup.net/">HTTP://roundup.net/</a>&gt;')
+        ae(t('&lt;http://roundup.net/&gt;.'),
+            '&lt;<a href="http://roundup.net/">http://roundup.net/</a>&gt;.')
+        ae(t('&lt;www.roundup.net&gt;'),
+           '&lt;<a href="http://www.roundup.net">www.roundup.net</a>&gt;')
+        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>).')
+        ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language))&gt;.'),
+           '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">'
+           'http://en.wikipedia.org/wiki/Python_(programming_language)</a>)&gt;.')
+        ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language&gt;)).'),
+           '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language">'
+           'http://en.wikipedia.org/wiki/Python_(programming_language</a>&gt;)).')
 
 '''
 class HTMLPermissions: