Example #1
0
    def test_should_intercept_ignore_paths(self):
        SilkyConfig().SILKY_IGNORE_PATHS = ['/ignorethis']
        request = Request()
        request.path = '/ignorethis'
        should_intercept = _should_intercept(request)

        self.assertFalse(should_intercept)
Example #2
0
    def test_should_intercept_ignore_paths(self):
        SilkyConfig().SILKY_IGNORE_PATHS = [
            '/ignorethis'
        ]
        request = Request()
        request.path = '/ignorethis'
        should_intercept = SilkyMiddleware()._should_intercept(request)

        self.assertFalse(should_intercept)
Example #3
0
    def test_should_intercept_silk_request(self):
        request = Request()
        request.path = reverse('silk:summary')
        should_intercept = _should_intercept(request)

        self.assertFalse(should_intercept)
Example #4
0
    def test_should_intercept_non_silk_request(self):
        request = Request()
        request.path = '/myapp/foo'
        should_intercept = _should_intercept(request)

        self.assertTrue(should_intercept)
Example #5
0
 def test_should_intercept_without_silk_urls(self):
     request = Request()
     request.path = '/login'
     _should_intercept(request)  # Just checking no crash
Example #6
0
    def test_should_intercept_non_silk_request(self):
        request = Request()
        request.path = '/myapp/foo'
        should_intercept = SilkyMiddleware()._should_intercept(request)

        self.assertTrue(should_intercept)
Example #7
0
    def test_should_intercept_silk_request(self):
        request = Request()
        request.path = reverse('silk:summary')
        should_intercept = SilkyMiddleware()._should_intercept(request)

        self.assertFalse(should_intercept)