def test_is_safe_url(self): """ Test the is_safe_url function. """ app = flask.Flask('fedora_elections') with app.test_request_context(): self.assertFalse( fedora_elections.is_safe_url('https://google.fr')) self.assertTrue( fedora_elections.is_safe_url('/admin/'))
def test_is_safe_url(self): """ Test the is_safe_url function. """ app = flask.Flask('elections') with app.test_request_context(): self.assertTrue(fedora_elections.is_safe_url('http://localhost')) self.assertTrue(fedora_elections.is_safe_url('https://localhost')) self.assertTrue( fedora_elections.is_safe_url('http://localhost/test')) self.assertFalse( fedora_elections.is_safe_url('http://fedoraproject.org/')) self.assertFalse( fedora_elections.is_safe_url('https://fedoraproject.org/'))
def test_is_safe_url(self): """ Test the is_safe_url function. """ app = flask.Flask('elections') with app.test_request_context(): self.assertTrue( fedora_elections.is_safe_url('http://localhost')) self.assertTrue( fedora_elections.is_safe_url('https://localhost')) self.assertTrue( fedora_elections.is_safe_url('http://localhost/test')) self.assertFalse( fedora_elections.is_safe_url('http://fedoraproject.org/')) self.assertFalse( fedora_elections.is_safe_url('https://fedoraproject.org/'))
def test_is_safe_url(self): """ Test the is_safe_url function. """ app = flask.Flask('fedora_elections') with app.test_request_context(): self.assertFalse(fedora_elections.is_safe_url('https://google.fr')) self.assertTrue(fedora_elections.is_safe_url('/admin/'))