def test_delete_issue_will_delete_extended_fields(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issueextfields-list', kwargs={'task_id': 1})
    self.client.post(url, {'name': '广场'})
    self.client.post(url, {'name': '手机型号', 'isOptional': True, 'default': 'iPhone', 'type': 'string'})
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'extFields': {'广场': '通州万达', '手机型号': '华为'}}, format='json')
    issue_id = response.data['data']['id']
    url = reverse('issues-detail', kwargs={'pk': issue_id})
    response = self.client.delete(url)
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(self._get_business_status_code(response), status.HTTP_200_OK)
    self.assertEqual(0, IssueExtValue.objects.filter(issue_id=issue_id).count())
def test_delete_issue_will_delete_extended_fields(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issueextfields-list', kwargs={'task_id': 1})
    self.client.post(url, {'name': '广场'})
    self.client.post(url, {'name': '手机型号', 'isOptional': True, 'default': 'iPhone', 'type': 'string'})
    response = self.client.post(reverse('issues-list'), {'priority': '紧急', 'appId': 1, 'taskId': 1, 'statusId': 1, 'title': 'aaaa', 'detail': 'bbbb', 'extFields': {'广场': '通州万达', '手机型号': '华为'}}, format='json')
    issue_id = response.data['data']['id']
    url = reverse('issues-detail', kwargs={'pk': issue_id})
    response = self.client.delete(url)
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(self._get_business_status_code(response), status.HTTP_200_OK)
    self.assertEqual(0, IssueExtValue.objects.filter(issue_id=issue_id).count())