def test_ssl_only_insecure_request_fails(self):
    self.initialize(scope_names=['verify'])
    settings.DJOAUTH2_SSL_ONLY = True

    access_token = self.create_access_token(self.user, self.client)

    api_request = self.oauth_client.make_api_request(
        access_token, {}, use_ssl=False)

    api_endpoint = make_oauth_protected_endpoint('verify')

    response = api_endpoint(api_request)
    self.assertIsInstance(response, HttpResponse, response)
    self.assertEqual(response.status_code, 400, response.status_code)
Test that insecure requests fail when the backend requires all
dataset/ETHPy150Open Locu/djoauth2/djoauth2/tests/test_endpoint.py/TestOAuthScopeEndpointDecorator.test_ssl_only_insecure_request_fails