示例#1
0
 def testDeleteEntity(self):
     base = Base()
     base.name = 'Base name'
     base.put()
     baseInserted = Base.all().fetch(1)[0]
     baseInserted.delete()
     self.assertEqual(len(Base.all().fetch(1)), 0)
示例#2
0
 def testUpdateEntity(self):
     base = Base()
     base.name = 'Base name'
     base.put()
     baseInserted = Base.all().fetch(1)[0]
     baseInserted.name = 'Another base name'
     baseInserted.put()
     baseUpdated = Base.all().fetch(1)[0]
     self.assertEqual(baseInserted.name , baseUpdated.name)
示例#3
0
 def testReadEntity(self):
     base = Base()
     base.name = 'Base name'
     base.put()
     baseInserted = Base.all().fetch(1)[0]
     self.assertEqual(base.name, baseInserted.name)
示例#4
0
 def testCreatetentity(self):
     base = Base()
     base.name = 'Base name'
     base.put()
     self.assertEqual(1, len(Base.all().fetch(1)))