def test_issue_stats_test_filter_start_end_time(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issuestats')
    data = {'startTime': '2017-01-01'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 10)
    data = {'startTime': '2017-10-01', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 2)
    data = {'startTime': '2017-10-01', 'appId': 6, 'endTime': '2017-10-10'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 2)
    data = {'startTime': '2017-09-01', 'appId': 6, 'endTime': '2017-09-30'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'startTime': '2017-11-01', 'appId': 6, 'endTime': '2017-11-30'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
def test_issue_stats_test_filter_start_end_time(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    url = reverse('issuestats')
    data = {'startTime': '2017-01-01'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 10)
    data = {'startTime': '2017-10-01', 'appId': 6}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 2)
    data = {'startTime': '2017-10-01', 'appId': 6, 'endTime': '2017-10-10'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 2)
    data = {'startTime': '2017-09-01', 'appId': 6, 'endTime': '2017-09-30'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)
    data = {'startTime': '2017-11-01', 'appId': 6, 'endTime': '2017-11-30'}
    response = self.client.get(url, data, format='json')
    self.assertEqual(response.data['data']['totalIssues'], 0)