def testSelectObjectToView_by_oid_in_hex(self): oid = u64(self.root['stub']._p_oid) hex_oid = hex(oid).rstrip('L') view = ZodbInfoView(self.root, TestRequest(form={'oid': hex_oid})) self.assertEquals(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_find_parent_fail_fall_back_to_root(self): view = ZodbInfoView(self.root['stub']['member']['notpersistent'], TestRequest()) view.jar = self.root._p_jar self.assertEquals(view.selectObjectToView(), self.root)
def testSelectObjectToView_by_oid(self): oid = u64(self.root['stub']._p_oid) view = ZodbInfoView(self.root, TestRequest(form={'oid': str(oid)})) self.assertEquals(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_use_context(self): view = ZodbInfoView(self.root, TestRequest()) self.assertEquals(view.selectObjectToView(), self.root) view = ZodbInfoView(self.root['root']['item'], TestRequest()) self.assertEquals(view.selectObjectToView(), self.root['root']['item'])
def testSelectObjectToView_find_parent(self): view = ZodbInfoView(self.root['stub']['member'], TestRequest()) self.assertEquals(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_by_oid_in_hex(self): oid = u64(self.root['stub']._p_oid) hex_oid = hex(oid).rstrip('L') view = ZodbInfoView(self.root, TestRequest(form={'oid': hex_oid})) self.assertEqual(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_by_oid(self): oid = u64(self.root['stub']._p_oid) view = ZodbInfoView(self.root, TestRequest(form={'oid': str(oid)})) self.assertEqual(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_find_parent_fail_fall_back_to_root(self): view = ZodbInfoView(self.root['stub']['member']['notpersistent'], TestRequest()) view.jar = self.root._p_jar self.assertEqual(view.selectObjectToView(), self.root)
def testSelectObjectToView_find_parent(self): view = ZodbInfoView(self.root['stub']['member'], TestRequest()) self.assertEqual(view.selectObjectToView(), self.root['stub'])
def testSelectObjectToView_use_context(self): view = ZodbInfoView(self.root, TestRequest()) self.assertEqual(view.selectObjectToView(), self.root) view = ZodbInfoView(self.root['root']['item'], TestRequest()) self.assertEqual(view.selectObjectToView(), self.root['root']['item'])