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

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

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django_browserid/tests/test_auth.py   socorro(Download)
        backend.User.DoesNotExist = Exception
        backend.User.objects.get.side_effect = backend.User.DoesNotExist
        with self.assertRaises(IntegrityError) as e:
            backend.create_user('a@example.com')
        self.assertEqual(e.exception, error)

src/t/r/treeherder-service-HEAD/vendor/django_browserid/tests/test_util.py   treeherder-service(Download)
    def test_no_setting(self):
        """If the setting doesn't exist, raise ImproperlyConfigured."""
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('DOES_NOT_EXIST')
 
    @override_settings(TEST_SETTING={})
    def test_invalid_import(self):
        """If the setting isn't a proper string, raise ImproperlyConfigured."""
        with self.assertRaises(ImproperlyConfigured):
    def test_failed_import(self, import_module):
        """If there is an error importing the module, raise ImproperlyConfigured."""
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
    def test_error_importing(self, import_module):
        """If there is an error importing the module, raise ImproperlyConfigured."""
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
    def test_missing_attribute(self, import_module):
        """If the module is imported, but the function isn't found, raise ImproperlyConfigured."""
        import_module.return_value = Mock(spec=[])
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django_browserid/tests/test_base.py   socorro(Download)
            settings.DEBUG = False
 
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
 
        with self.settings(BROWSERID_AUDIENCES=['https://example.com']):
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.bar
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.expires
 
        with patch('django_browserid.base.requests.post') as post:
            post.side_effect = request_exception
            with self.assertRaises(base.BrowserIDException) as cm:
                verifier.verify('asdf', 'http://testserver')
 

src/a/f/affiliates-HEAD/vendor-local/packages/django-browserid/django_browserid/tests/test_auth.py   affiliates(Download)
        backend.User.DoesNotExist = Exception
        backend.User.objects.get.side_effect = backend.User.DoesNotExist
        with self.assertRaises(IntegrityError) as e:
            backend.create_user('a@example.com')
        self.assertEqual(e.exception, error)

src/a/f/affiliates-HEAD/vendor-local/packages/django-browserid/django_browserid/tests/test_base.py   affiliates(Download)
            settings.DEBUG = False
 
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
 
        with self.settings(BROWSERID_AUDIENCES=['https://example.com']):
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.bar
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.expires
 
        with patch('django_browserid.base.requests.post') as post:
            post.side_effect = request_exception
            with self.assertRaises(base.BrowserIDException) as cm:
                verifier.verify('asdf', 'http://testserver')
 

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django_browserid/tests/test_util.py   socorro(Download)
    def test_no_setting(self):
        """If the setting doesn't exist, raise ImproperlyConfigured."""
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('DOES_NOT_EXIST')
 
        ImproperlyConfigured.
        """
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
 
        """
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
        import_module.assert_called_with('foo.bar')
        """
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
        import_module.assert_called_with('foo.bar')
        """
        import_module.return_value = Mock(spec=[])
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
 

src/p/l/playdoh-lib-HEAD/lib/python/django_browserid/tests/test_auth.py   playdoh-lib(Download)
        backend.User.DoesNotExist = Exception
        backend.User.objects.get.side_effect = backend.User.DoesNotExist
        with self.assertRaises(IntegrityError) as e:
            backend.create_user('a@example.com')
        self.assertEqual(e.exception, error)

src/a/f/affiliates-HEAD/vendor-local/packages/django-browserid/django_browserid/tests/test_util.py   affiliates(Download)
    def test_no_setting(self):
        """If the setting doesn't exist, raise ImproperlyConfigured."""
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('DOES_NOT_EXIST')
 
        ImproperlyConfigured.
        """
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
 
        """
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
        import_module.assert_called_with('foo.bar')
        """
        import_module.side_effect = ImportError
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
        import_module.assert_called_with('foo.bar')
        """
        import_module.return_value = Mock(spec=[])
        with self.assertRaises(ImproperlyConfigured):
            import_from_setting('TEST_SETTING')
 

src/p/l/playdoh-lib-HEAD/lib/python/django_browserid/tests/test_base.py   playdoh-lib(Download)
            settings.DEBUG = False
 
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
 
        with self.settings(BROWSERID_AUDIENCES=['https://example.com']):
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.bar
 
        """
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
            result.expires
 
        with patch('django_browserid.base.requests.post') as post:
            post.side_effect = request_exception
            with self.assertRaises(base.BrowserIDException) as cm:
                verifier.verify('asdf', 'http://testserver')
 

src/t/r/treeherder-service-HEAD/vendor/django_browserid/tests/test_base.py   treeherder-service(Download)
            settings.DEBUG = False
 
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
 
        with self.settings(BROWSERID_AUDIENCES=['https://example.com']):
            with self.assertRaises(ImproperlyConfigured):
                base.get_audience(request)
 
    def test_getattr_attribute_doesnt_exist(self):
        # If a value doesn't exist in the response dict, accessing it as
        # an attribute should raise an AttributeError.
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
    def test_expires_no_attribute(self):
        # If no expires attribute was in the response, raise an
        # AttributeError.
        result = base.VerificationResult({'myattr': 'foo'})
        with self.assertRaises(AttributeError):
        with patch('django_browserid.base.requests.post') as post:
            post.side_effect = request_exception
            with self.assertRaises(base.BrowserIDException) as cm:
                verifier.verify('asdf', 'http://testserver')
 

  1 | 2  Next