def test_post_lifecycle(self):
        # create a post object
        post = WordPressPost()
        post.title = 'Test post'
        post.slug = 'test-post'
        post.description = 'This is test post using the XML-RPC API.'
        post.allow_comments = True
        post.user = self.userid

        # create the post as a draft
        post_id = self.client.call(posts.NewPost(post, False))
        self.assertTrue(post_id)

        # fetch the newly-created post
        post2 = self.client.call(posts.GetPost(post_id))
        self.assertTrue(isinstance(post2, WordPressPost))
        self.assertEqual(str(post2.id), post_id)

        # publish the post
        response = self.client.call(posts.PublishPost(post_id))
        self.assertEqual(str(response), post_id)

        # update the post
        post2.description += '<br><b>Updated:</b> This post has been updated.'
        response = self.client.call(posts.EditPost(post_id, post2, True))
        self.assertTrue(response)

        # delete the post
        response = self.client.call(posts.DeletePost(post_id))
        self.assertTrue(response)