Esempio n. 1
0
    def _make_admin_request_custom_status(self, action, params, status):
        """
        Make authenticated 'admin' request with a custom HTTP status expected
        as response. By default self.app.get will raise an exception when
        something other and 2xx or 3xx is returned.
        """
        params.update({'session': self.session})
        headers = {
            'Authorization':
            TestController.get_http_digest_header(username='******'),
        }
        TestController.set_cookie(self.app, 'admin_session', self.session)

        return self.app.get(
            url(controller='admin', action=action),
            params=params,
            headers=headers,
            status=status,
        )
Esempio n. 2
0
    def _make_admin_request_custom_status(self, action, params, status):
        """
        Make authenticated 'admin' request with a custom HTTP status expected
        as response. By default self.app.get will raise an exception when
        something other and 2xx or 3xx is returned.
        """
        params.update({'session': self.session})
        headers = {
            'Authorization': TestController.get_http_digest_header(
                username='******'
                ),
            }
        TestController.set_cookie(self.app, 'admin_session', self.session)

        return self.app.get(
            url(controller='admin', action=action),
            params=params,
            headers=headers,
            status=status,
            )
Esempio n. 3
0
 def getDefaultAuthorization(self):
     return TestController.get_http_digest_header(username='******')
Esempio n. 4
0
 def getDefaultAuthorization(self):
     return TestController.get_http_digest_header(username='******')