Commit a5830619 authored by Tres Seaver's avatar Tres Seaver

Test non-replacement of methods with other '_setObject' assertions.

parent c2ce4798
......@@ -328,6 +328,10 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
self.assertRaises(BadRequest, om._setObject, '111', si)
self.assertRaises(BadRequest, om._setObject, 'REQUEST', si)
self.assertRaises(BadRequest, om._setObject, '/', si)
self.assertRaises(BadRequest, om._setObject, 'get', si)
self.assertRaises(BadRequest, om._setObject, 'items', si)
self.assertRaises(BadRequest, om._setObject, 'keys', si)
self.assertRaises(BadRequest, om._setObject, 'values', si)
def test_getsetitem(self):
om = self._makeOne()
......@@ -386,7 +390,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
def test_get(self):
om = self._makeOne()
si1 = SimpleItem('1')
self.assertRaises(BadRequest, om.__setitem__, 'get', si1)
om['1'] = si1
self.failUnless(om.get('1') == si1)
# A contained item overwrites the method
......@@ -401,7 +404,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
def test_items(self):
om = self._makeOne()
si1 = SimpleItem('1')
self.assertRaises(BadRequest, om.__setitem__, 'items', si1)
om['1'] = si1
self.failUnless(('1', si1) in om.items())
# A contained item overwrites the method
......@@ -416,7 +418,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
def test_keys(self):
om = self._makeOne()
si1 = SimpleItem('1')
self.assertRaises(BadRequest, om.__setitem__, 'keys', si1)
om['1'] = si1
self.failUnless('1' in om.keys())
# A contained item overwrites the method
......@@ -431,7 +432,6 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
def test_values(self):
om = self._makeOne()
si1 = SimpleItem('1')
self.assertRaises(BadRequest, om.__setitem__, 'values', si1)
om['1'] = si1
self.failUnless(si1 in om.values())
# A contained item overwrites the method
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment