@mock.patch('apps.issue.views.zc_set_jira_status', side_effect=mocked_zc_set_jira_status)
@mock.patch('apps.issue.views.jira_issue_is_avaliable', side_effect=mocked_jira_issue_is_avaliable)
def test_update_jira_comment_with_empty_jira_info(self, mock_obj_1, mock_obj_2):
    response = self.client.post(reverse('issues-jiracomment', kwargs={'pk': 1}), {'conclusion': 'fail', 'comment': 'first comment'})
    self.assertEqual(response.data['status'], 200)
    self.assertEqual(response.data['data']['comments'][0]['info'], 'first comment')
    self.assertEqual(response.data['data']['comments'][0]['wanxin'], 'app_owner_user')
    self.assertEqual(response.data['data']['changeLog'][0], 'status changed!')
    response = self.client.post(reverse('issues-jiracomment', kwargs={'pk': 1}), {'conclusion': 'fail', 'comment': 'second comment'})
    self.assertEqual(response.data['status'], 200)
    self.assertEqual(response.data['data']['comments'][0]['info'], 'second comment')
    self.assertEqual(response.data['data']['comments'][0]['wanxin'], 'app_owner_user')
    self.assertEqual(response.data['data']['changeLog'][0], 'status changed!')
@mock.patch('apps.issue.views.zc_set_jira_status', side_effect=mocked_zc_set_jira_status)
@mock.patch('apps.issue.views.jira_issue_is_avaliable', side_effect=mocked_jira_issue_is_avaliable)
def test_update_jira_comment_with_empty_jira_info(self, mock_obj_1, mock_obj_2):
    response = self.client.post(reverse('issues-jiracomment', kwargs={'pk': 1}), {'conclusion': 'fail', 'comment': 'first comment'})
    self.assertEqual(response.data['status'], 200)
    self.assertEqual(response.data['data']['comments'][0]['info'], 'first comment')
    self.assertEqual(response.data['data']['comments'][0]['wanxin'], 'app_owner_user')
    self.assertEqual(response.data['data']['changeLog'][0], 'status changed!')
    response = self.client.post(reverse('issues-jiracomment', kwargs={'pk': 1}), {'conclusion': 'fail', 'comment': 'second comment'})
    self.assertEqual(response.data['status'], 200)
    self.assertEqual(response.data['data']['comments'][0]['info'], 'second comment')
    self.assertEqual(response.data['data']['comments'][0]['wanxin'], 'app_owner_user')
    self.assertEqual(response.data['data']['changeLog'][0], 'status changed!')