def test_forum_update_last_post(topic, user):
 post = Post(content='Test Content 2')
 post.save(topic=topic, user=user)
 assert (topic.forum.last_post == post)
 post.delete()
 topic.forum.update_last_post()
 assert (topic.forum.last_post == topic.first_post)

def test_forum_update_last_post ( topic , user ) : post = Post ( content = 'Test Content 2' ) post . save ( topic = topic , user = user ) assert ( topic . forum . last_post == post ) post . delete ( ) topic . forum . update_last_post ( ) assert ( topic . forum . last_post == topic . first_post )
test the update last post method .