Example #1
0
 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/'))
Example #2
0
    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/'))
Example #3
0
    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/'))
Example #4
0
 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/'))