SHARE
TWEET

test

a guest Jul 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     @allure.title('Create work order with comment and cancel it')
  2.     def test_work_order_with_comment(self):
  3.         affiliate = env_config.get('TEST_STATIC', 'affiliate_id')
  4.         with step('Create work order'):
  5.             user_id = self.ticket_api.get_user_info()['id']
  6.             work_order_body = self.ticket_generator.generate_work_order_body(affiliate, user_id)
  7.             work_order_id = self.ticket_api.create_work_order(work_order_body)['_id']
  8.         with step('Comment work order'):
  9.             comment_body = self.ticket_generator.generate_comment_body(affiliate, created_work_order['_id'], user_id)
  10.             created_comment = self.ticket_api.add_comment_work_order(comment_body)
  11.         with step('Check comment present for work order'):
  12.             comments = self.ticket_api.get_work_order_comments({'work_order_id': created_work_order['_id']})['_items']
  13.             assert created_comment['_id'] in [_['_id'] for _ in comments]
  14.             outcome_comment = [_ for _ in comments if _['_id'] == created_comment['_id']][0]
  15.             self.compare_values('text', outcome_comment['text'], created_comment['text'])
  16.         with step('Cancel work order'):
  17.             self.ticket_api.update_work_order(work_order_id, status='canceled')
  18.         with step('Delete work order'):
  19.             self.ticket_api.delete_all_test_work_orders_with_audit_and_comments(affiliate)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top