def testSyncTumblrWithCache(self): tumblrPosts.setOverrideTTL(0) models.Post.objects.all().delete() remotePosts = tumblrPosts.remotePosts(tumblrAPI) tumblrPosts.syncLocalPostsWith(remotePosts) localPosts = tumblrPosts.localPosts() self.assertTrue(tumblrPosts.isCacheSynced(localItems=localPosts, remoteItems=remotePosts))
def testSaveTumblrPostToCache(self): post = tumblrPosts.remotePosts(tumblrAPI)[0] models.Post.TumblrPostToCache(post)
def testRetrieveFromTumblr(self): self.assertTrue(type(tumblrPosts.remotePosts(tumblrAPI)[0]['unix-timestamp'])==type(1.0))