예제 #1
0
 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'])
예제 #2
0
 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)
예제 #3
0
 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'])
예제 #4
0
 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'])
예제 #5
0
 def testSelectObjectToView_find_parent(self):
     view = ZodbInfoView(self.root['stub']['member'], TestRequest())
     self.assertEquals(view.selectObjectToView(), self.root['stub'])
예제 #6
0
 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'])
예제 #7
0
 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'])
예제 #8
0
 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)
예제 #9
0
 def testSelectObjectToView_find_parent(self):
     view = ZodbInfoView(self.root['stub']['member'], TestRequest())
     self.assertEqual(view.selectObjectToView(), self.root['stub'])
예제 #10
0
 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'])