> I got unit tests asserting on the raw output using the tools in
> testutil and the tutorial up on that, and I can see in testutil that
> there _exist_ tools for more ( BrowsingSession? ) but I can't find any
> docs on using them and there are no comments in testutil. I mucked
> around with experiments but didn't get far.
BTW this is what I have working so far in my test file, dunno how to
make it keep a session going:
test_config = {
"server.environment":"production",
"server.socket_port":9080,
"server.logToScreen":True,
"session_filter.on":True,
}
# module setup, turn on cp for the tests,
def setup():
print "module setup starting cherrypy"
cp.config.update( test_config )
cp.root = Root()
cp.server.start( initOnly=True )
# tell testutil that cherrypy is started,
setattr( cp.root, 'started', True )
def teardown():
cp.server.stop()
def test_session():
'attempt to get session vars going with direct calls'
cp.serving.request = tu.DummyRequest()
d = cp.root.page1()
print "test_session response dict: ", d
# d should be different if the session var worked
def test_session2():
'attempt2 to get session vars going with direct calls'
cp.serving.request = tu.DummyRequest()
d = cp.root.page1()
print "test_session response dict: ", d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---