def test_create_issues_with_report_source(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '0')
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'reportSource': '四大区运营', 'score': '非常严重'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '5')
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'reportSource': '四大区运营'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '4')
def test_create_issues_with_report_source(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '0')
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'reportSource': '四大区运营', 'score': '非常严重'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '5')
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'reportSource': '四大区运营'})
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(response.data['data']['score'], '4')