修复add和copy用例因testraili没有输入导致不能添加的问题

This commit is contained in:
ray 2020-01-20 14:43:46 +08:00 committed by GitHub
parent a875f76e3b
commit e86502fe48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ def add_case(request):
case_dict = {"projectid": post_dict['projectid'],
"moduleid": post_dict['moduleid'],
"casedesc": post_dict['casedesc'],
"testrailcaseid": post_dict['testrailcaseid'],
"testrailcaseid": post_dict['testrailcaseid'] if 'testrailcaseid' in post_dict else None
"dependent": post_dict['dependent']
}
@ -142,7 +142,7 @@ def copy_case(request, id):
"moduleid": post_dict['moduleid'],
"casedesc": post_dict['casedesc'],
"dependent": post_dict['dependent'],
"testrailcaseid": post_dict['testrailcaseid']
"testrailcaseid": post_dict['testrailcaseid'] if 'testrailcaseid' in post_dict else None
}
projectid = Project.objects.get(pk=int(case_dict.get('projectid')))
@ -275,4 +275,4 @@ def run_case(request):
else:
os.system("python seleniumkeyword/TestSuite.py -c " + depentid + "," + caseid)
# print caseid
return HttpResponse('true')
return HttpResponse('true')