Esempio n. 1
0
 def test_fix_redirect_url(self):
     for (test_input, expected_output) in (
         ('https://google.com', 'https://google.com'),
         ('google.com', 'https://google.com'),
         ('https://www.google.com', 'https://www.google.com'),
     ):
         self.assertEqual(
             expected_output,
             utils.fix_redirect_url(test_input, 'https')
         )
     self.assertEqual(
         'http://google.com',
         utils.fix_redirect_url('google.com', 'http'),
     )
Esempio n. 2
0
 def clean_thanks_url(self):
     return fix_redirect_url(self.cleaned_data["thanks_url"], "http")
Esempio n. 3
0
 def clean_error_url(self):
     return fix_redirect_url(self.cleaned_data["error_url"], "http")
Esempio n. 4
0
 def clean_content_url(self):
     return fix_redirect_url(self.cleaned_data["content_url"], "http")