Exemplo n.º 1
0
def add_test(request):
    if request.method == "POST":
        form = TestForm(request.POST)
        if form.is_valid():
            form.save()
            git_co_task.delay(0)
            return http_success(request, u'测试例添加成功')
    else:
        form = TestForm()
    return render_to_response('release/add_test.html', locals(), RequestContext(request))
Exemplo n.º 2
0
def edit_test(request, ID):
    the_test = Test.objects.get(id=ID)
    the_test.host_list = list(eval(the_test.host_list))
    if request.method == "POST":
        form = TestForm(request.POST, instance=the_test)
        if form.is_valid():
            form.save()
            git_co_task.delay(ID)
            return http_success(request, u'测试例修改成功')
    else:
        form = TestForm(instance=the_test)
    return render_to_response('release/edit_test.html', locals(), RequestContext(request))
Exemplo n.º 3
0
def add_test(request):
    if request.method == "POST":
        form = TestForm(request.POST)
        if form.is_valid():
            form.save()
            git_co_task.delay(0)
            return http_success(request, u'测试例添加成功')
    else:
        form = TestForm()
    return render_to_response('release/add_test.html', locals(),
                              RequestContext(request))
Exemplo n.º 4
0
def edit_test(request, ID):
    the_test = Test.objects.get(id=ID)
    the_test.host_list = list(eval(the_test.host_list))
    if request.method == "POST":
        form = TestForm(request.POST, instance=the_test)
        if form.is_valid():
            form.save()
            git_co_task.delay(ID)
            return http_success(request, u'测试例修改成功')
    else:
        form = TestForm(instance=the_test)
    return render_to_response('release/edit_test.html', locals(),
                              RequestContext(request))