def test_deletion(self):
        """Test the deletion of a blog post and the accompanying deletion of
        tags"""
        self.clear_db()
        self.register_and_login('barney', 'abc')
        
        self.add_post(title='Title', markup='', tags='cool')
        posts = Post.query.all()
        tags = Tag.query.all()
        
        assert_equal(len(posts), 1)
        assert_equal(len(tags), 1)
        
        rv = self.delete_post(slug='idontexist')
        assert 'No such post' in rv.data
        rv = self.delete_post(slug='title')
        assert 'Post deleted' in rv.data
        
        posts = Post.query.all()
        tags = Tag.query.all()
        
        assert_equal(len(posts), 0)
        assert_equal(len(tags), 0)
dataset/ETHPy150Open eugenkiss/Simblin/test/test_views.py/TestPost.test_deletion/original