def test_request_must_be_secure(self): environ = self.get_wsgi_environ() environ['wsgi.url_scheme'] = 'https' request = HttpRequest(environ) self.assertTrue(request.is_secure(), "Request must be secure")
def test_request_must_be_ajax(self): environ = self.get_wsgi_environ() environ['HTTP_X_REQUESTED_WITH'] = 'XMLHTTPRequest' request = HttpRequest(environ) self.assertTrue(request.is_ajax(), "Request must be ajax")