Testing

class kinto.core.testing.DummyRequest(*args, **kwargs)

Fully mocked request.

follow_subrequest(request, subrequest, **kwargs)

Run a subrequest (e.g. batch), and follow the redirection if any.

Return type:tuple
Returns:the reponse and the redirection request (or subrequest if no redirection happened.)
class kinto.core.testing.FormattedErrorMixin

Test mixin in order to perform advanced error responses assertions.

kinto.core.testing.get_user_headers(user, password='secret')

Helper to obtain a Basic Auth authorization headers from the specified user (e.g. "user:pass")

Return type:dict
class kinto.core.testing.BaseWebTest

Base Web Test to test your kinto.core service.

It setups the database before each test and delete it after.

api_prefix = 'v0'

URL version prefix

entry_point = None

Main application entry

classmethod make_app(settings=None, config=None)

Instantiate the application and setup requests to use the api prefix.

Parameters:
Returns:

webtest application instance

classmethod get_app_settings(extras=None)

Application settings to be used. Override to tweak default settings for the tests.

Parameters:extras (dict) – extra settings values
Return type:dict