Skip to content

Commit

Permalink
Test deleting comments
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 14, 2015
1 parent 201f3e0 commit 2fee353
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions weblate/trans/tests/test_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from django.core.urlresolvers import reverse

from weblate.trans.tests.test_views import ViewTestCase
from weblate.trans.models import Comment


class CommentViewTest(ViewTestCase):
Expand Down Expand Up @@ -101,3 +102,21 @@ def test_add_source_comment(self):
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())

0 comments on commit 2fee353

Please sign in to comment.