[Zope] Comparing returned Python Script values

Andreas Pauley andreasp@qbcon.com
Sun, 17 Jun 2001 23:56:54 +0200


Hi,

I have two Python Scripts that returns a string when called.
I need to test if the returned string values are equal.

For testing purposes I have created two Python Scripts (script1 and
script2), each containing only the following line of code:
return 'test'

The following DTML tells me that my strings are not equal:
<dtml-if expr="script1 == script2">
    Strings are equal
<dtml-else>
    Strings are *not* equal
</dtml-if>

The following Python Code does the same:
if context.script1 == context.script2:
	print 'Strings are equal'
else:
	print 'Strings are *not* equal'

return printed

Printing context.script1 and context.script2 gives me this:
<PythonScript instance at 87e6168>
<PythonScript instance at 86ce928>

It seems that I'm comparing the script instances instead of their
returned values.
How do I get to compare the returned values?

Thanks a lot,
Andreas.