def test_post_save(topic, user):
 post = Post(content='Test Content')
 post.save(topic=topic, user=user)
 assert (post.content == 'Test Content')
 post.content = 'Test Edit Content'
 post.save()
 assert (post.content == 'Test Edit Content')
 assert (topic.user.post_count == 2)
 assert (topic.post_count == 2)
 assert (topic.last_post == post)
 assert (topic.forum.post_count == 2)

def test_post_save ( topic , user ) : post = Post ( content = 'Test Content' ) post . save ( topic = topic , user = user ) assert ( post . content == 'Test Content' ) post . content = 'Test Edit Content' post . save ( ) assert ( post . content == 'Test Edit Content' ) assert ( topic . user . post_count == 2 ) assert ( topic . post_count == 2 ) assert ( topic . last_post == post ) assert ( topic . forum . post_count == 2 )
tests the save post method .