for example:
def index():
"""
>>> request.vars.update(title='xxx'
>>> assert(len(index()['articles'].find(r:r['title']=='xxx'))==1)
>>> db(db.article.title=='xxx').delete()
1
"""
form = SQLFORM(db.article)
if form.accepts(request.vars): response.flash = "óÔÁÔØÑ
ÄÏÂÁ×ÌÅÎÁ"
articles = db().select(db.article.ALL)
return dict(articles=articles, form=form)
On Jan 15, 7:29 am, walter <[email protected]> wrote:
> This is my code
> def index():
> form = SQLFORM(db.article)
> if form.accepts(request.vars): response.flash = "óÔÁÔØÑ ÄÏÂÁ×ÌÅÎÁ"
>
> articles = db().select(db.article.ALL)
> return dict(articles=articles, form=form)
>
> I can't understand how to test index? How to test articles value for
> example?