This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View Pylons - Web 開發瑞士刀 as PDF for free.
tests/functional/test_kagin.py from kaho.tests import * class TestKaginController(TestController): def test_index(self): response = self.app.get(url(controller='kagin', action='index')) # Test response... assert 'jogin' in response
% nosetests kaho/tests/functional/test_kagin.py # path is relative with test.ini & development.ini
F ================================================= FAIL: test_index (kaho.tests.functional.test_kagin.TestKaginController)
------------------------------------------------Traceback (most recent call last): File "kaho/tests/functional/test_kagin.py", line 8, assert 'jogin' in response AssertionError
in test_index
------------------------------------------------Ran 1 test in 0.005s FAILED (failures=1)
controllers/kagin.py class KaginController(BaseController): def index(self): # Return a rendered template #return render('/kagin.mako') # or, return a response return 'Hello World, Jinja jogin?'
% nosetests kaho/tests/functional/test_kagin.py
. --------------------------------------------Ran 1 test in 0.005s OK
tests/functional/test_kagin.py ... # print out in tests, stype a print >> sys.stderr, '' # print out in tests, stype b logging.warn(response.session['times']) assert not response.session.has_key('times')
# 更多關於 tests in pylons: # http://pylonshq.com/docs/en/0.9.7/testing/
1.0 目標是成為完整而精鋉的 Web 應用框架。 目前預測是在 2009 前半年間釋出 Pylons 1.0 。
變形蟲的潛力? * Tuborgears 2 "the built on top of the experience of several next generation web frameworks including TurboGears 1 (of course), Django, and Rails." http://turbogears.org/2.0/ * Shabti "A collection of customised project templates for Pylons intended to provide some quick and easy kickstarts for building web applications in Pylons." http://bel-epa.com/shabtidocs/
Question:What do you want?
「我想要開發一個 Web 應用程式?」 go-django.py command not found (yet): go-django.py 「一個小中小企業用的 Web ,能在 MVC 部份有充分的 彈性,以因應企業 ( 幸運地 ) 在未來成長上的變化。」 go-pylons.py 「一個能讓我選擇 ORM 及 Templating ; 甚至 ( 最好不要有 ) 哪一天,可以改寫替換架構中的 任一部份的框架。」 go-pylons.py