示例#1
0
 def test_linkify_works_without_protocol(self):
     expected = '<a href="http://www.example.com" target="_blank">www.example.com</a>'
     actual = utils.linkify('www.example.com')
     assert actual == expected
示例#2
0
 def test_linkify_linkifies_url_with_uppercase_letters(self):
     expected = '<a href="Http://Www.Example.Com" target="_blank">Http://Www.Example.Com</a>'
     actual = utils.linkify('Http://Www.Example.Com')
     assert actual == expected
示例#3
0
 def test_linkify_linkifies_url_without_www(self):
     expected = '<a href="http://example.com" target="_blank">http://example.com</a>'
     actual = utils.linkify('http://example.com')
     assert actual == expected
示例#4
0
 def test_linkify_works_without_protocol(self):
     expected = '<a href="http://www.example.com" target="_blank">www.example.com</a>'
     actual = utils.linkify('www.example.com')
     assert actual == expected
示例#5
0
 def test_linkify_linkifies_url_with_uppercase_letters(self):
     expected = '<a href="Http://Www.Example.Com" target="_blank">Http://Www.Example.Com</a>'
     actual = utils.linkify('Http://Www.Example.Com')
     assert actual == expected
示例#6
0
 def test_linkify_linkifies_url_without_www(self):
     expected = '<a href="http://example.com" target="_blank">http://example.com</a>'
     actual = utils.linkify('http://example.com')
     assert actual == expected