示例#1
0
 def test_fix_image_url(self):
     for (test_input, expected_output) in (
         ('example.com/test.jpeg', 'https://example.com/test.jpeg'),
         ('//example.com/test.jpeg', '//example.com/test.jpeg'),
         ('http://example.com/test.jpeg', 'http://example.com/test.jpeg'),
         ('https://example.com/test.jpeg', 'https://example.com/test.jpeg'),
     ):
         self.assertEqual(
             expected_output,
             utils.fix_image_url(test_input)
         )
示例#2
0
 def clean_og_image(self):
     og_image = self.cleaned_data["og_image"]
     return fix_image_url(og_image)