Exemplo n.º 1
0
 def testCreatetentity(self):
     user = UserAccount(name="Cherny")
     album = Album()
     album.name = 'Album name'
     album.userAcount = user.put()
     album.maxPages = 9
     album.PDFUrl = 'http://whatever'
     album.size = [10, 15]
     album.put()
     self.assertEqual(1, len(Album.all().fetch(1)))
Exemplo n.º 2
0
 def testUpdateEntity(self):
     user = UserAccount(name="Cherny")
     album = Album()
     album.name = 'Album name'
     album.userAcount = user.put()
     album.maxPages = 9
     album.PDFUrl = 'http://whatever'
     album.size = [10, 15]
     album.put()
     albumInserted = Album.all().fetch(1)[0]
     albumInserted.name = 'Another album name'
     albumInserted.put()
     albumUpdated = Album.all().fetch(1)[0]
     self.assertEqual(albumInserted.name , albumUpdated.name)
Exemplo n.º 3
0
 def testDeleteEntity(self):
     user = UserAccount(name="ssss4545454545Cherny")
     album = Album()
     album.name = 'Album name'
     album.userAcount = user.put()
     album.maxPages = 9
     album.PDFUrl = 'http://whatever'
     album.size = [10, 15]
     album.put()
     albumInserted = Album.all().fetch(1)[0]
     albumInserted.name = 'Another album name'
     album.put()
     albumInserted = Album.all().fetch(1)[0]
     albumInserted.delete()
     self.assertEqual(len(Album.all().fetch(1)), 0)