def test_ticket_update_request_by_authorized_users(self, config, login, password): db_user = GkrDbSteps(config) session = HttpSteps.HttpSession() login_url = config.base_url + Urls.LOGIN.url + '/ajax' ticket_edit_url = config.base_url + Urls.ADMIN_TICKED_EDIT.url advance_updated = db_user.fill_advance_queue(Departments.SIMF_DEP, Services.SINGLE_WINDOW, datetime.now(), ObjectTypes.STROI_OBJECT, OPERATOR) params = { 'id': advance_updated.id, 'serviceid': advance_updated.service_id, 'inputData': rand_str(10), 'objectsCount': 2 } session.with_method('post').with_params({ 'username': login, 'password': password }).with_url(login_url).submit() session.with_method('post').with_url( ticket_edit_url % advance_updated.id).with_params(params).submit() sleep(2) advance_changed = db_user.query_first( Advance, advance_updated.id == advance_updated.id) db_user.delete_advance_by_id(advance_updated.id) assert_that( advance_changed.objects_count, equal_to(1), 'Запрос изменения тикета ' + ticket_edit_url % advance_updated.id + ' открыт для авторизованного пользователя ' + login)
def fin(): config = getattr(request, '_funcargs')['config'] db_steps = GkrDbSteps(config) db_steps.delete_user_by_mobile( history_operator.customers_data.mobile_phone) if advance_one is not None: db_steps.delete_advance_by_id(advance_one.id, advance_two.id)