add text field to add comment to ticket
This commit is contained in:
parent
5a1de437b6
commit
d1626d1777
6 changed files with 102 additions and 18 deletions
|
@ -175,6 +175,23 @@ class IssueApiTest(TestCase):
|
|||
self.assertEqual(response.json()['issue_thread'], issue.id)
|
||||
self.assertEqual(response.json()['timestamp'], response.json()['timestamp'])
|
||||
|
||||
def test_post_comment_altenative(self):
|
||||
issue = IssueThread.objects.create(
|
||||
name="test issue",
|
||||
)
|
||||
response = self.client.post(f'/api/2/tickets/{issue.id}/comment/', {'comment': 'test'})
|
||||
self.assertEqual(response.status_code, 201)
|
||||
self.assertEqual(response.json()['comment'], 'test')
|
||||
self.assertEqual(response.json()['issue_thread'], issue.id)
|
||||
self.assertEqual(response.json()['timestamp'], response.json()['timestamp'])
|
||||
|
||||
def test_post_alt_comment_empty(self):
|
||||
issue = IssueThread.objects.create(
|
||||
name="test issue",
|
||||
)
|
||||
response = self.client.post(f'/api/2/tickets/{issue.id}/comment/', {'comment': ''})
|
||||
self.assertEqual(response.status_code, 400)
|
||||
|
||||
def test_state_change(self):
|
||||
issue = IssueThread.objects.create(
|
||||
name="test issue",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue