コード例 #1
0
def testapp(request,app):
    urls = []
    error = None
    definitions = TestViewDefinitions(app)
    if definitions.exists():
        urls = definitions.urls()
    else:
        error = "Failed to import from app %s" % (app)
    return render_to_response("urllist.html",
                {'app':app,
                 "urls": urls,
                 "error":error
                 },
                context_instance=RequestContext(request))    
コード例 #2
0
def testurl(request,app,test_id): 
    urls = []
    error = None
    definitions = TestViewDefinitions(app)
    if definitions.exists():
        urls = definitions.urls()
    else:
        error = "Failed to import from app %s" % (app)
    test_id = int(test_id)
    (test_url,test_text) = urls[ test_id - 1]
    prev = None
    next = None
    if test_id != 1:
        prev = test_id - 1
    if test_id != len(urls):
        next = test_id + 1
    return render_to_response("testview.html",
                {"testurl": test_url,
                 "testtext":test_text,
                 "prev": prev,
                 "next": next,
                 'app': app,
                 "error":error, },
                context_instance=RequestContext(request))