Commit 2fee3539 authored by Michal Čihař's avatar Michal Čihař

Test deleting comments

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 201f3e00
......@@ -25,6 +25,7 @@ Tests for comment views.
from django.core.urlresolvers import reverse
from weblate.trans.tests.test_views import ViewTestCase
from weblate.trans.models import Comment
class CommentViewTest(ViewTestCase):
......@@ -101,3 +102,21 @@ class CommentViewTest(ViewTestCase):
translation.unit_set.count_type('sourcecomments', translation),
1
)
def test_delete_comment(self):
unit = self.get_unit()
# Add comment
response = self.client.post(
reverse('comment', kwargs={'pk': unit.id}),
{
'comment': 'New target testing comment',
'scope': 'translation',
}
)
comment = Comment.objects.all()[0]
response = self.client.post(
reverse('delete-comment', kwargs={'pk': comment.pk})
)
self.assertRedirects(response, unit.get_absolute_url())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment