def test_filter_issues_by_department(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.get(reverse('issues-list'), {'department': '网科集团', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '网科', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '质量管理部', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '质量', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '地产集团', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '不存在部门', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 0)
    response = self.client.get(reverse('issues-list'), {'department': '地产集团', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '地产', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '工程部', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '工', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '不存在部门', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 0)
def test_filter_issues_by_department(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.get(reverse('issues-list'), {'department': '网科集团', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '网科', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '质量管理部', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '质量', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '地产集团', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '不存在部门', 'appId': 1})
    self.assertEqual(self._get_response_total(response), 0)
    response = self.client.get(reverse('issues-list'), {'department': '地产集团', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '地产', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '工程部', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '工', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 1)
    response = self.client.get(reverse('issues-list'), {'department': '不存在部门', 'appId': 2})
    self.assertEqual(self._get_response_total(response), 0)