diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -368,7 +368,7 @@ class Post(models.Model, Viewable): thread.last_edit_time = timezone.now() thread.save() - super(Post, self).delete(using) + super(Post, self).delete(using) logging.getLogger('boards.post.delete').info( 'Deleted post P#{}/{}'.format(self.id, self.get_title())) diff --git a/boards/tests/test_post.py b/boards/tests/test_post.py --- a/boards/tests/test_post.py +++ b/boards/tests/test_post.py @@ -37,9 +37,12 @@ class PostTests(TestCase): thread = opening_post.get_thread() reply = Post.objects.create_post("", "", thread=thread) - thread.delete() + opening_post.delete() - self.assertFalse(Post.objects.filter(id=reply.id).exists()) + self.assertFalse(Post.objects.filter(id=reply.id).exists(), + 'Reply was not deleted with the thread.') + self.assertFalse(Post.objects.filter(id=opening_post.id).exists(), + 'Opening post was not deleted with the thread.') def test_post_to_thread(self): """Test adding post to a thread"""