def step_impl(context, user, project_name): project = bdd_util.get_project(context.client.user, project_name) project_data = {'id': project.id} url = '/project/api/project/' response = context.client.delete(url, project_data) bdd_util.assert_api_call_success(response)
def step_impl(context, user, project_name): project = bdd_util.get_project(context.client.user, project_name) url = '/project/api/project/?id=%d' % project.id response = context.client.get(url) actual = json.loads(response.content)['data'] expected = json.loads(context.text) bdd_util.assert_dict(expected, actual)
def step_impl(context, user, project_name): project = bdd_util.get_project(context.client.user, project_name) project_data = json.loads(context.text) project_data['id'] = project.id url = '/project/api/project/' response = context.client.post(url, project_data) bdd_util.assert_api_call_success(response)
def step_impl(context, user, project_user_name, project_name): project = bdd_util.get_project(context.client.user, project_name) project_user_id = bdd_util.get_user_id_for(project_user_name) data = { 'project_id': project.id, 'user_id': project_user_id, 'set_to_manager': 'false' } url = '/project/api/project_manager/set/' response = context.client.post(url, data) bdd_util.assert_api_call_success(response)
def step_impl(context, user): context.project = bdd_util.get_project(context.client.user, u'看板')
def step_impl(context, user, project_name): context.project = bdd_util.get_project(context.client.user, project_name)
def step_impl(context, user, is_manager, project_name): project = bdd_util.get_project(context.client.user, project_name) response = context.client.get('/project/users/?project_id=%d' % project.id) expected = True if is_manager == u'是' else False actual = response.context['request'].user.is_manager context.tc.assertEquals(expected, actual)