示例#1
0
 def test_marksup_multiple_urls(self):
     result = mark_up_urls(
         "http://commcarehq.org redirects to https://commcarehq.org.")
     self.assertEqual(
         result, '<a href="http://commcarehq.org">http://commcarehq.org</a>'
         ' redirects to <a href="https://commcarehq.org">https://commcarehq.org</a>.'
     )
示例#2
0
 def html(self):
     return mark_up_urls(self.text)
示例#3
0
 def html(self):
     return mark_up_urls(self.text)
示例#4
0
 def test_handles_empty_string(self):
     result = mark_up_urls('')
     self.assertEqual(result, '')
示例#5
0
 def test_output_with_urls_is_safe(self):
     result = mark_up_urls('this points to http://google.com')
     self.assertIsInstance(result, SafeString)
示例#6
0
 def test_creates_markup(self):
     result = mark_up_urls('Please see http://google.com for more info.')
     self.assertEqual(
         result,
         'Please see <a href="http://google.com">http://google.com</a> for more info.'
     )
示例#7
0
 def test_string_without_urls_returns_string(self):
     result = mark_up_urls('This has no urls')
     self.assertEqual(result, 'This has no urls')