make tickets assignable to users
This commit is contained in:
parent
4be8109753
commit
e605292bf0
11 changed files with 317 additions and 110 deletions
|
@ -297,4 +297,21 @@ class IssueApiTest(TestCase):
|
|||
)
|
||||
response = self.client.patch(f'/api/2/tickets/{issue.id}/', {'state': 'invalid'},
|
||||
content_type='application/json')
|
||||
self.assertEqual(response.status_code, 400)
|
||||
self.assertEqual(400, response.status_code)
|
||||
|
||||
def test_assign_user(self):
|
||||
issue = IssueThread.objects.create(
|
||||
name="test issue",
|
||||
)
|
||||
response = self.client.patch(f'/api/2/tickets/{issue.id}/', {'assigned_to': self.user.username},
|
||||
content_type='application/json')
|
||||
self.assertEqual(200, response.status_code)
|
||||
self.assertEqual('pending_new', response.json()['state'])
|
||||
self.assertEqual('test issue', response.json()['name'])
|
||||
self.assertEqual(self.user.username, response.json()['assigned_to'])
|
||||
timeline = response.json()['timeline']
|
||||
self.assertEqual(2, len(timeline))
|
||||
self.assertEqual('state', timeline[0]['type'])
|
||||
self.assertEqual('pending_new', timeline[0]['state'])
|
||||
self.assertEqual('assignment', timeline[1]['type'])
|
||||
self.assertEqual(self.user.username, timeline[1]['assigned_to'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue