Example #1
0
def get_testsuit_project_format(datas):
    for item in datas:
        get_data(item)
        create_time_list = item['update_time'].split('T')
        first_part = create_time_list[0]
        second_part = create_time_list[1].split('.')[0]
        item['update_time'] = first_part + ' ' + second_part
    return datas
Example #2
0
 def retrieve(self, request, *args, **kwargs):
     report = self.get_object()
     serializer = self.get_serializer(instance=report)
     datas = get_data(serializer.data)
     try:
         datas['summary'] = json.loads(datas['summary'], encoding='utf-8')
     except Exception as e:
         pass
     return Response(datas)
Example #3
0
def get_interface_list_format(datas):
    for item in datas:
        item = get_data(item)
        interface_id = item['id']
        testcases = Testcases.objects.filter(interface_id=interface_id).count()
        configures = Configures.objects.filter(interface_id=interface_id).count()
        item['testcases'] = testcases
        item['configures'] = configures
    return datas
Example #4
0
def get_envs_list_format(datas):
    for item in datas:
        get_data(item)
    return datas
Example #5
0
 def retrieve(self, request, *args, **kwargs):
     instance = self.get_object()
     serializer = self.get_serializer(instance)
     data = get_data(serializer.data)
     return Response(data)
Example #6
0
 def retrieve(self, request, *args, **kwargs):
     response = super().retrieve(request, *args, **kwargs)
     response.data = get_data(response.data)
     return response
Example #7
0
def get_reports_format(datas):
    for item in datas:
        get_data(item)
    return datas