~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to tests/test_webapps/filestotest/controller_sample.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
from projectname.lib.base import *
4
4
import projectname.lib.helpers as h
5
 
# from pylons import h as deprecated_h
6
 
from pylons import request, response, session
 
5
from pylons import request, response, session, url
7
6
from pylons import tmpl_context as c
8
7
from pylons import app_globals
9
8
from pylons.decorators import rest
10
9
from pylons.i18n import _, get_lang, set_lang, LanguageError
11
10
from pylons.templating import render_mako, render_genshi, render_jinja2
12
 
from pylons.controllers.util import abort, redirect_to, url_for
 
11
from pylons.controllers.util import abort, redirect
13
12
 
14
13
class SampleController(BaseController):
15
14
    def index(self):
30
29
        return str(app_globals.counter)
31
30
    
32
31
    def myself(self):
33
 
        return h.url_for()
 
32
        return request.url
34
33
    
35
34
    def myparams(self):
36
35
        return str(request.params)
38
37
    def testdefault(self):
39
38
        c.test = "This is in c var"
40
39
        return render_genshi('testgenshi.html')
41
 
 
42
 
    # def testdefault_legacy(self):
43
 
    #     c.test = "This is in c var"
44
 
    #     return old_render('testgenshi')
45
40
        
46
41
    def test_template_caching(self):
47
42
        return render_mako('/test_mako.html', cache_expire='never')
94
89
        set_lang([])
95
90
        response.write(_('No languages'))
96
91
        return ''
97
 
        
98
 
    # def deprecated_h(self):
99
 
    #     return '%s is %s' % (h.url_for(), deprecated_h.url_for())