private void CreateContext()
{
if (CreateTestUser)
CreateUserForTests();
AdminSession = CreateAdminSession(Database);
AdminSession.Context.RouteImmediate<ErrorEvent>(e => {
if (errors == null)
errors = new List<Exception>();
if (e.Level != ErrorLevel.Warning)
errors.Add(e.Error);
});
AdminQuery = CreateQuery(AdminSession);
}