[CMF-checkins] CVS: CMF/CMFDefault/tests - test_MetadataTool.py:1.4
Shane Hathaway
shane@cvs.zope.org
Thu, 20 Jun 2002 15:53:25 -0400
Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv17401/tests
Modified Files:
test_MetadataTool.py
Log Message:
Since elements and policies are now SimpleItems, they must always be
wrapped. Otherwise the name REQUEST resolves to the special value
"Acquisition.Acquired" and DTML leaves the realm of sanity. ;-)
Arranged for wrapping at the appropriate times and updated unit tests
accordingly.
=== CMF/CMFDefault/tests/test_MetadataTool.py 1.3 => 1.4 ===
+from Acquisition import aq_base
from unittest import TestCase, TestSuite, makeSuite, main
from Products.CMFDefault.MetadataTool import \
@@ -175,7 +176,7 @@
# Fetch (default) policy for a type.
tDoc = tSpec.getPolicy( 'Document' )
- assert tDoc == tDef
+ self.assertEqual(aq_base(tDoc), aq_base(tDef))
# Changing default changes policies found from there.
tDef.edit( 1, 1, 'xyz', 0, () )
@@ -190,14 +191,14 @@
assert len( tSpec.listPolicies() ) == 2
tDoc = tSpec.getPolicy( 'Document' )
- assert tDoc != tDef
+ self.assertNotEqual(aq_base(tDoc), aq_base(tDef))
assert not tDoc.isRequired()
assert not tDoc.supplyDefault()
assert not tDoc.defaultValue()
tSpec.removePolicy( 'Document' )
tDoc = tSpec.getPolicy( 'Document' )
- assert tDoc == tDef
+ self.assertEqual(aq_base(tDoc), aq_base(tDef))
assert tDoc.isRequired()
assert tDoc.supplyDefault()
assert tDoc.defaultValue() == 'xyz'
@@ -216,7 +217,7 @@
# Fetch (default) policy for a type.
sDoc = sSpec.getPolicy( 'Document' )
- assert sDoc == sDef
+ self.assertEqual(aq_base(sDoc), aq_base(sDef))
# Changing default changes policies found from there.
sDef.edit( 1, 1, 'xyz', 1, ( 'foo', 'bar' ) )
@@ -239,7 +240,7 @@
assert len( sSpec.listPolicies() ) == 2
sDoc = sSpec.getPolicy( 'Document' )
- assert sDoc != sDef
+ self.assertNotEqual(aq_base(sDoc), aq_base(sDef))
assert not sDoc.isRequired()
assert not sDoc.supplyDefault()
assert not sDoc.defaultValue()
@@ -248,7 +249,7 @@
sSpec.removePolicy( 'Document' )
sDoc = sSpec.getPolicy( 'Document' )
- assert sDoc == sDef
+ self.assertEqual(aq_base(sDoc), aq_base(sDef))
assert sDoc.isRequired()
assert sDoc.supplyDefault()
assert sDoc.defaultValue() == 'xyz'