コード例 #1
0
ファイル: test_utils.py プロジェクト: edgeflip/edgeflip
 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")