def review_testcases_view(request, test_plan_id):
    """Review and remove testcases in a testplan"""
    testplan = TestPlan.objects.get(id=test_plan_id)
    return render_to_response(
        'test_plan_review_testcases.html',
        {"testplan": testplan,
        'teams': json.dumps(Folder.get_root_folder().child_nodes(test_plan_id)),
        }, context_instance=RequestContext(request))
示例#2
0
def review_testcases_view(request, test_plan_id):
    """Review and remove testcases in a testplan"""
    testplan = TestPlan.objects.get(id=test_plan_id)
    return render_to_response(
        'test_plan_review_testcases.html',
        {"testplan": testplan,
        'teams': json.dumps(Folder.get_root_folder().child_nodes(test_plan_id)),
        }, context_instance=RequestContext(request))
示例#3
0
def ajax_plan_details(request):
    testplan_id = request.GET.get('testplan_id', None)
    folder_id = int(request.GET.get('key', '-100'))
    if folder_id == -100:
        folder_id = Folder.get_root_folder().id
    testplan_testcase_count = TestPlan.objects.get(pk=testplan_id).testcases.count()
    folder_testcase_count = TestPlan.objects.get(pk=testplan_id).testcases.filter(folder__id=folder_id).count()
    return HttpResponse(json.dumps({'testplan_testcase_count': testplan_testcase_count,
                                    'folder_testcase_count': folder_testcase_count
    })
    )
def test_plan_add_results(request, test_plan_id):
    """ Called when results are added to a test plan """

    testplan = TestPlan.objects.get(id=test_plan_id)
    tests = testplan.testcases.filter(enabled=True)
    return render_to_response('test_plan_add_results.html', {
        'plan': testplan,
        'tests': tests,
        'results': Result.objects.filter(testplan_testcase_link__testplan=testplan),
        'teams': json.dumps(Folder.get_root_folder().child_nodes(test_plan_id)),
        'bug_url': settings.BUG_TRACKING_URL
        }, context_instance=RequestContext(request))
示例#5
0
def ajax_folders(request):
    node = None
    if '-100' == request.GET.get('key', '-100'):
        node = Folder.get_root_folder()
    else:
        node = Folder.objects.get(pk=request.GET['key'])

    return HttpResponse(json.dumps({
        'id': node.id,
        'parent_id': node.parent_id,
        'node_list': node.child_nodes(request.GET.get('testplan_id', None)),
        'testplan_id': request.GET.get('testplan_id', None)
    }))
示例#6
0
def ajax_plan_details(request):
    testplan_id = request.GET.get('testplan_id', None)
    folder_id = int(request.GET.get('key', '-100'))
    if folder_id == -100:
        folder_id = Folder.get_root_folder().id
    testplan_testcase_count = TestPlan.objects.get(
        pk=testplan_id).testcases.count()
    folder_testcase_count = TestPlan.objects.get(
        pk=testplan_id).testcases.filter(folder__id=folder_id).count()
    return HttpResponse(
        json.dumps({
            'testplan_testcase_count': testplan_testcase_count,
            'folder_testcase_count': folder_testcase_count
        }))
def test_case_summary_view(request):
    """ A view for listing the root cases in the database"""
    root = Folder.objects.get(name="root")
    #GET ONLY ENABLED CASES. DISABLED CASES CAN BE REQUESTED THROUGH AJAX REQUEST
    tests = TestCase.objects.filter(enabled=True).order_by('id')
    if 'showsubtree' not in request.GET:
        tests = tests.filter(folder=root)

    bulk_form = TestCaseBulkForm()
    return render_to_response('test_case_summary.html',
                              {'tests': tests,
                               'bulk_form': bulk_form,
                               'teams': json.dumps(Folder.get_root_folder().child_nodes())
                               },
                              context_instance=RequestContext(request))
示例#8
0
def ajax_folders(request):
    node = None
    if '-100' == request.GET.get('key', '-100'):
        node = Folder.get_root_folder()
    else:
        node = Folder.objects.get(pk=request.GET['key'])

    return HttpResponse(
        json.dumps({
            'id':
            node.id,
            'parent_id':
            node.parent_id,
            'node_list':
            node.child_nodes(request.GET.get('testplan_id', None)),
            'testplan_id':
            request.GET.get('testplan_id', None)
        }))
示例#9
0
def test_plan_add_results(request, test_plan_id):
    """ Called when results are added to a test plan """

    testplan = TestPlan.objects.get(id=test_plan_id)

    # Check the connection to the bug server
    try:
        jira = JIRA(options={'server': settings.BUG_SERVER}, basic_auth=(settings.BUG_USER, settings.BUG_PASSWORD))
        jira.server_info()
        connected = "true"

    except:
        connected = "false"

    return render_to_response('test_plan_add_results.html', {
        'plan': testplan,
        'tests': testplan.testcases.filter(enabled=True),
        'results': Result.objects.filter(testplan_testcase_link__testplan=testplan),
        'teams': json.dumps(Folder.get_root_folder().child_nodes(test_plan_id)),
        'bug_url': settings.BUG_TRACKING_URL,
        'bug_form': BugForm(initial={'reporter': request.user}),
        'connected': connected
        }, context_instance=RequestContext(request))
示例#10
0
def test_plan_add_results(request, test_plan_id):
    """ Called when results are added to a test plan """

    testplan = TestPlan.objects.get(id=test_plan_id)

    # Check the connection to the bug server
    try:
        jira = JIRA(options={'server': settings.BUG_SERVER}, basic_auth=(settings.BUG_USER, settings.BUG_PASSWORD))
        jira.server_info()
        connected = "true"

    except:
        connected = "false"

    return render_to_response('test_plan_add_results.html', {
        'plan': testplan,
        'tests': testplan.testcases.filter(enabled=True),
        'results': Result.objects.filter(testplan_testcase_link__testplan=testplan),
        'teams': json.dumps(Folder.get_root_folder().child_nodes(test_plan_id)),
        'bug_url': settings.BUG_TRACKING_URL,
        'bug_form': BugForm(initial={'reporter': request.user}),
        'connected': connected
        }, context_instance=RequestContext(request))
示例#11
0
def test_case_summary_view(request):
    """ A view for listing the root cases in the database"""
    if TestCase.objects.count() == 0:
        welcome = True
    else:
        welcome = False

    root = Folder.objects.get(name="root")
    # GET ONLY ENABLED CASES. DISABLED CASES CAN BE REQUESTED THROUGH AJAX REQUEST
    tests = TestCase.objects.filter(enabled=True).order_by("id")
    if "showsubtree" not in request.GET:
        tests = tests.filter(folder=root)

    bulk_form = TestCaseBulkForm()
    return render_to_response(
        "test_case_summary.html",
        {
            "tests": tests,
            "bulk_form": bulk_form,
            "welcome": welcome,
            "teams": json.dumps(Folder.get_root_folder().child_nodes()),
        },
        context_instance=RequestContext(request),
    )