Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(115)  |  Call(115)  |  Derive(0)  |  Import(0)

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django_browserid/tests/test_base.py   socorro(Download)
 
        # Test if allowed properly.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=['https://login.persona.org']):
 
        # Test fallback to default-src.
        with self.settings(CSP_DEFAULT_SRC=['https://login.persona.org'],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test incorrect csp.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test partial incorrectness.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=[]):
 
        audiences = ['https://example.com', 'http://testserver']
        with self.settings(BROWSERID_AUDIENCES=audiences, DEBUG=False):
            eq_(base.get_audience(request), 'http://testserver')
 

src/a/f/affiliates-HEAD/vendor-local/packages/django-browserid/django_browserid/tests/test_base.py   affiliates(Download)
 
        # Test if allowed properly.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=['https://login.persona.org']):
 
        # Test fallback to default-src.
        with self.settings(CSP_DEFAULT_SRC=['https://login.persona.org'],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test incorrect csp.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test partial incorrectness.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=[]):
 
        audiences = ['https://example.com', 'http://testserver']
        with self.settings(BROWSERID_AUDIENCES=audiences, DEBUG=False):
            eq_(base.get_audience(request), 'http://testserver')
 

src/p/l/playdoh-lib-HEAD/lib/python/django_browserid/tests/test_base.py   playdoh-lib(Download)
 
        # Test if allowed properly.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=['https://login.persona.org']):
 
        # Test fallback to default-src.
        with self.settings(CSP_DEFAULT_SRC=['https://login.persona.org'],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test incorrect csp.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test partial incorrectness.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=[]):
 
        audiences = ['https://example.com', 'http://testserver']
        with self.settings(BROWSERID_AUDIENCES=audiences, DEBUG=False):
            eq_(base.get_audience(request), 'http://testserver')
 

src/t/r/treeherder-service-HEAD/vendor/django_browserid/tests/test_base.py   treeherder-service(Download)
 
        # Test if allowed properly.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=['https://login.persona.org']):
 
        # Test fallback to default-src.
        with self.settings(CSP_DEFAULT_SRC=['https://login.persona.org'],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test incorrect csp.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test partial incorrectness.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=[]):
 
        audiences = ['https://example.com', 'http://testserver']
        with self.settings(BROWSERID_AUDIENCES=audiences, DEBUG=False):
            eq_(base.get_audience(request), 'http://testserver')
 

src/d/j/django-browserid-0.10/django_browserid/tests/test_base.py   django-browserid(Download)
 
        # Test if allowed properly.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=['https://login.persona.org']):
 
        # Test fallback to default-src.
        with self.settings(CSP_DEFAULT_SRC=['https://login.persona.org'],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test incorrect csp.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=[],
                           CSP_FRAME_SRC=[]):
 
        # Test partial incorrectness.
        with self.settings(CSP_DEFAULT_SRC=[],
                           CSP_SCRIPT_SRC=['https://login.persona.org'],
                           CSP_FRAME_SRC=[]):
 
        audiences = ['https://example.com', 'http://testserver']
        with self.settings(BROWSERID_AUDIENCES=audiences, DEBUG=False):
            eq_(base.get_audience(request), 'http://testserver')
 

src/t/r/treeherder-service-HEAD/vendor/django_browserid/tests/test_views.py   treeherder-service(Download)
    def test_no_assertion(self):
        # If no assertion is given, return a failure result.
        with self.settings(LOGIN_REDIRECT_URL_FAILURE='/fail'):
            response = self.verify('post', blah='asdf')
        eq_(response.status_code, 403)
    def test_auth_fail(self):
        # If authentication fails, redirect to the failure URL.
        with self.settings(LOGIN_REDIRECT_URL_FAILURE='/fail'):
            response = self.verify('post', assertion='asdf')
        eq_(response.status_code, 403)
    def test_auth_fail_url_parameters(self):
        # Ensure that bid_login_failed=1 is appended to the failure url.
        with self.settings(LOGIN_REDIRECT_URL_FAILURE='/fail?'):
            response = self.verify('post', assertion='asdf')
        self.assert_json_equals(response.content, {'redirect': '/fail?bid_login_failed=1'})
 
        with self.settings(LOGIN_REDIRECT_URL_FAILURE='/fail?asdf'):
        self.assert_json_equals(response.content, {'redirect': '/fail?asdf&bid_login_failed=1'})
 
        with self.settings(LOGIN_REDIRECT_URL_FAILURE='/fail?asdf=4'):
            response = self.verify('post', assertion='asdf')
        self.assert_json_equals(response.content, {'redirect': '/fail?asdf=4&bid_login_failed=1'})

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django_browserid/tests/test_helpers.py   socorro(Download)
    def test_defaults(self):
        with self.settings(BROWSERID_REQUEST_ARGS={'foo': 'bar', 'baz': 1}):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_lazy_request_args(self):
        with self.settings(BROWSERID_REQUEST_ARGS=lazy_request_args()):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_custom_shim(self):
        with self.settings(BROWSERID_SHIM='http://example.com/test.js'):
            output = helpers.browserid_js()
        self.assertHTMLEqual(output, """
            <script type="text/javascript" src="http://example.com/test.js"></script>
    def test_login_class(self):
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(link_class='go button')
        self.assertHTMLEqual(button, """
            <a href="#" class="go button" data-next="/">
        'browserid-login persona-button'.
        """
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login()
        self.assertHTMLEqual(button, """

src/a/f/affiliates-HEAD/vendor-local/packages/django-browserid/django_browserid/tests/test_helpers.py   affiliates(Download)
    def test_defaults(self):
        with self.settings(BROWSERID_REQUEST_ARGS={'foo': 'bar', 'baz': 1}):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_lazy_request_args(self):
        with self.settings(BROWSERID_REQUEST_ARGS=lazy_request_args()):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_custom_shim(self):
        with self.settings(BROWSERID_SHIM='http://example.com/test.js'):
            output = helpers.browserid_js()
        self.assertHTMLEqual(output, """
            <script type="text/javascript" src="http://example.com/test.js"></script>
    def test_login_class(self):
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(link_class='go button')
        self.assertHTMLEqual(button, """
            <a href="#" class="go button" data-next="/">
        'browserid-login persona-button'.
        """
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login()
        self.assertHTMLEqual(button, """

src/p/l/playdoh-lib-HEAD/lib/python/django_browserid/tests/test_helpers.py   playdoh-lib(Download)
    def test_defaults(self):
        with self.settings(BROWSERID_REQUEST_ARGS={'foo': 'bar', 'baz': 1}):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_lazy_request_args(self):
        with self.settings(BROWSERID_REQUEST_ARGS=lazy_request_args()):
            output = helpers.browserid_info()
 
        eq_(output, self.render_to_string.return_value)
    def test_custom_shim(self):
        with self.settings(BROWSERID_SHIM='http://example.com/test.js'):
            output = helpers.browserid_js()
        self.assertHTMLEqual(output, """
            <script type="text/javascript" src="http://example.com/test.js"></script>
    def test_login_class(self):
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(link_class='go button')
        self.assertHTMLEqual(button, """
            <a href="#" class="go button" data-next="/">
        'browserid-login persona-button'.
        """
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login()
        self.assertHTMLEqual(button, """

src/t/r/treeherder-service-HEAD/vendor/django_browserid/tests/test_helpers.py   treeherder-service(Download)
    def test_custom_shim(self):
        with self.settings(BROWSERID_SHIM='http://example.com/test.js'):
            output = helpers.browserid_js()
        self.assertHTMLEqual(output, """
            <script type="text/javascript" src="http://example.com/test.js"></script>
    def test_login_class(self):
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(link_class='go button')
        self.assertHTMLEqual(button, """
            <a href="#" class="go button" data-next="/">
    def test_default_class(self):
        # If no class is provided, it should default to
        # 'browserid-login persona-button'
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login()
    def test_color_class(self):
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(color='dark')
        self.assertHTMLEqual(button, """
            <a href="#" class="browserid-login persona-button dark" data-next="/">
    def test_color_custom_class(self):
        # If using a color and a custom link class, persona-button
        # should be added to the link class.
        with self.settings(LOGIN_REDIRECT_URL='/'):
            button = helpers.browserid_login(link_class='go button', color='dark')

  1 | 2  Next