예제 #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'),
     )
예제 #2
0
파일: forms.py 프로젝트: edgeflip/edgeflip
 def clean_thanks_url(self):
     return fix_redirect_url(self.cleaned_data["thanks_url"], "http")
예제 #3
0
파일: forms.py 프로젝트: edgeflip/edgeflip
 def clean_error_url(self):
     return fix_redirect_url(self.cleaned_data["error_url"], "http")
예제 #4
0
파일: forms.py 프로젝트: edgeflip/edgeflip
 def clean_content_url(self):
     return fix_redirect_url(self.cleaned_data["content_url"], "http")