[Zope3-Users] TestRequest

xor exor makkalot at gmail.com
Sat Sep 15 10:41:26 EDT 2007


Hi i'm trying some of the doc tests in the modules,but everytime i try to
use TestRequest igot lots of errors. My code is :

from zope import interface
from zope import schema

class IKisi(interface.Interface):
    """ Insan evladi"""

    first=schema.TextLine(required=False,title=u'First Name')
    last=schema.TextLine(required=True,title=u'Last Name')

name=['makkalot','makov']


class Dataci(object):
    """ Bisiler yapcak iste insan falan"""

    def getData(self):
        global name
        return {'first':name[0],'last':name[1]}

    def setData(self,data):
        global name

        name[0]=data['first']
        name[1]=data['last']

        return u'Saved changes'

if __name__=="__main__":
    from zope.app.form.browser.formview import FormView
    View = type('View', bases=(Dataci, FormView),dict={'schema': IKisi})
    print View

    from zope.publisher.browser import TestRequest
    request=TestRequest()

    view=View(None,request)
    print view


What is the problem???
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20070915/49003085/attachment.htm


More information about the Zope3-users mailing list