def testUpdateEntity(self): user = UserAccount(name="Cherny") image = Image() image.name = 'Image name' image.userAccount = user.put() image.picasaID = 'http://whatever' image.ThumbnaiUrl = 'http://whatever' image.size = [10, 15] image.css = '{rule : property;}' image.put() imageInserted = Image.all().fetch(1)[0] imageInserted.name = 'Another image name' imageInserted.put() imageUpdated = Image.all().fetch(1)[0] self.assertEqual(imageInserted.name , imageUpdated.name)
def testCreatetentity(self): user = UserAccount(name="Cherny") image = Image() image.name = 'Image name' image.userAccount = user.put() image.picasaID = 'http://whatever' image.ThumbnaiUrl = 'http://whatever' image.size = [10, 15] image.css = '{rule : property;}' image.put() self.assertEqual(1, len(Image.all().fetch(1)))