Ejemplo n.º 1
0
def test_jquery_script_name():
    twc.core.request_local()['middleware'] = \
        twc.make_middleware(script_name='/lol')
    from tw2.jquery import jquery_js
    twc.core.request_local()['middleware'].script_name = '/lol'
    the_link = '/lol/resources/tw2.jquery/static/jquery/1.7.1/jquery.js'
    eq_(jquery_js.req().link, the_link)
Ejemplo n.º 2
0
def test_jquery_custom():
    from tw2.jquery import jquery_js
    the_link = "/foo/bar/jquery.js"
    jquery_js.link = the_link
    eq_(jquery_js.req().link, the_link)
Ejemplo n.º 3
0
def test_jquery_external():
    from tw2.jquery import jquery_js
    jquery_js.external = True
    the_link = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1//jquery.js'
    eq_(jquery_js.req().link, the_link)
Ejemplo n.º 4
0
def test_jquery_resource():
    from tw2.jquery import jquery_js
    the_link = '/resources/tw2.jquery/static/jquery/1.7.1/jquery.js'
    eq_(jquery_js.req().link, the_link)