| 139 | def test_urlize(self): |
| 140 | f = html.urlize |
| 141 | |
| 142 | items = ( |
| 143 | ("djangoproject.com", "<a href=\"http://djangoproject.com\">djangoproject.com</a>"), |
| 144 | ("django@example.com)", "<a href=\"mailto:django@example.com\">django@example.com</a>)"), |
| 145 | ("(djangoproject.com)", "(<a href=\"http://djangoproject.com\">djangoproject.com</a>)"), |
| 146 | ("djangoproject.com.", "<a href=\"http://djangoproject.com\">djangoproject.com</a>."), |
| 147 | ("http://en.wikipedia.org/wiki/Django_(web_framework)", |
| 148 | "<a href=\"http://en.wikipedia.org/wiki/Django_%28web_framework%29\">http://en.wikipedia.org/wiki/Django_(web_framework)</a>"), |
| 149 | ) |
| 150 | |
| 151 | for value, output in items: |
| 152 | self.check_output(f, value, output) |
| 153 | |
| 154 | f = curry(html.urlize, nofollow=True) |
| 155 | |
| 156 | items = ( |
| 157 | ("django@example.com djangoproject.com", |
| 158 | "<a href=\"mailto:django@example.com\">django@example.com</a> <a href=\"http://djangoproject.com\" rel=\"nofollow\">djangoproject.com</a>"), |
| 159 | ) |
| 160 | |
| 161 | for value, output in items: |
| 162 | self.check_output(f, value, output) |
| 163 | |