def METHOD_NAME(self):
    with self.app.test_request_context('/auth',
                                       method='POST',
                                       data={"username": "selfservice@realm1",
                                             "password": "test"}):
        res = self.app.full_dispatch_request()
        self.assertTrue(res.status_code == 200, res)
        result = res.json.get("result")
        self.assertTrue(result.get("status"), res.data)
        # In self.at_user we store the user token
        authtoken = result.get("value")
    # Check the form
    with self.app.test_request_context('/certificate',
                                       method='POST',
                                       data={"authtoken": authtoken.get("token")}):
        res = self.app.full_dispatch_request()
        self.assertTrue(res.status_code == 200, res)
        self.assertEqual(res.mimetype, 'text/html', res)
        # Check the form
        self.assertTrue(b"privacyIDEA Certificate Request" in res.data)
        self.assertTrue(b"Key strength" in res.data)
        self.assertTrue(b'input type="hidden" name="authtoken"' in res.data)
    # Check that missing authentication will result in an error
    with self.app.test_request_context('/certificate',
                                       method='POST',
                                       data={}):
        res = self.app.full_dispatch_request()
        self.assertTrue(res.status_code == 401, res)
    # GET-Request will fail, Method not allowed
    with self.app.test_request_context('/certificate',
                                       method='GET',
                                       data={}):
        res = self.app.full_dispatch_request()
        self.assertTrue(res.status_code == 405, res)