def test_issue_stats_test_filter_issue_from(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issuestats')
    data = {'issueFrom': 'local'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'remote'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'fake_one'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'issueFrom': 'local', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'remote', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'local', 'appId': 1}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'issueFrom': 'remote', 'appId': 2}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
def test_issue_stats_test_filter_issue_from(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issuestats')
    data = {'issueFrom': 'local'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'remote'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'fake_one'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'issueFrom': 'local', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'remote', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 1)
    data = {'issueFrom': 'local', 'appId': 1}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'issueFrom': 'remote', 'appId': 2}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)