def test_created_time_order_when_filter_issues_by_status_order_created_time(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='admin_user'))
    url = reverse('usergroups-list')
    data = {'type': UserGroupType.OWNER, 'appId': 6}
    response = self.client.get(url, data, format='json')
    group_id = response.data['data']['results'][0]['id']
    url = reverse('usergroupmems-list', kwargs={'group_id': group_id})
    data = {'account': 'app_owner_user'}
    self.client.post(url, data, format='json')
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.get(reverse('issueslite-list'), {'statusNameOrder': '关闭,处理中,待处理,挂起,验证', 'appId': 6})
    result = [(item['statusName'], item['createdAt']) for item in response.data['data']['results']]
    self.assertEqual(result, [('关闭', '2017-06-29T18:25:11.681308'), ('处理中', '2017-06-29T18:25:11.681308'), ('待处理', '2017-06-29T18:25:11.681308'), ('待处理', '2017-10-01T18:22:11.681308'), ('待处理', '2017-10-01T18:25:11.681308'), ('挂起', '2017-06-29T18:25:11.681308'), ('验证', '2017-06-29T18:25:11.681308')])
def test_created_time_order_when_filter_issues_by_status_order_created_time(self):
    self.client.force_authenticate(user=get_user_model().objects.get(username='admin_user'))
    url = reverse('usergroups-list')
    data = {'type': UserGroupType.OWNER, 'appId': 6}
    response = self.client.get(url, data, format='json')
    group_id = response.data['data']['results'][0]['id']
    url = reverse('usergroupmems-list', kwargs={'group_id': group_id})
    data = {'account': 'app_owner_user'}
    self.client.post(url, data, format='json')
    self.client.force_authenticate(user=get_user_model().objects.get(username='app_owner_user'))
    response = self.client.get(reverse('issueslite-list'), {'statusNameOrder': '关闭,处理中,待处理,挂起,验证', 'appId': 6})
    result = [(item['statusName'], item['createdAt']) for item in response.data['data']['results']]
    self.assertEqual(result, [('关闭', '2017-06-29T18:25:11.681308'), ('处理中', '2017-06-29T18:25:11.681308'), ('待处理', '2017-06-29T18:25:11.681308'), ('待处理', '2017-10-01T18:22:11.681308'), ('待处理', '2017-10-01T18:25:11.681308'), ('挂起', '2017-06-29T18:25:11.681308'), ('验证', '2017-06-29T18:25:11.681308')])