add migrations for state change

This commit is contained in:
j3d1 2023-12-28 21:20:49 +01:00
parent 626c9f23fe
commit fe9795d147
3 changed files with 59 additions and 20 deletions

View file

@ -39,7 +39,7 @@ class IssueApiTest(TestCase):
)
state = StateChange.objects.create(
issue_thread=issue,
state="new",
state="pending_new",
timestamp=now + timedelta(seconds=1),
)
mail2 = Email.objects.create(
@ -62,7 +62,7 @@ class IssueApiTest(TestCase):
self.assertEqual(len(response.json()), 1)
self.assertEqual(response.json()[0]['id'], issue.id)
self.assertEqual(response.json()[0]['name'], "test issue")
self.assertEqual(response.json()[0]['state'], "new")
self.assertEqual(response.json()[0]['state'], "pending_new")
self.assertEqual(response.json()[0]['assigned_to'], None)
self.assertEqual(response.json()[0]['last_activity'], issue.last_activity.strftime('%Y-%m-%dT%H:%M:%S.%fZ'))
self.assertEqual(len(response.json()[0]['timeline']), 4)
@ -80,7 +80,7 @@ class IssueApiTest(TestCase):
self.assertEqual(response.json()[0]['timeline'][0]['body'], 'test')
self.assertEqual(response.json()[0]['timeline'][0]['timestamp'],
mail1.timestamp.strftime('%Y-%m-%dT%H:%M:%S.%fZ'))
self.assertEqual(response.json()[0]['timeline'][1]['state'], 'new')
self.assertEqual(response.json()[0]['timeline'][1]['state'], 'pending_new')
self.assertEqual(response.json()[0]['timeline'][1]['timestamp'],
state.timestamp.strftime('%Y-%m-%dT%H:%M:%S.%fZ'))
self.assertEqual(response.json()[0]['timeline'][2]['sender'], 'test')