Пример #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)))
Пример #2
0
 def testReadEntity(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]
     self.assertEqual(album.name, albumInserted.name)
Пример #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)