partition tickets by event

This commit is contained in:
j3d1 2024-11-13 23:51:54 +01:00
parent d73bebd5de
commit 41b71bd51a
8 changed files with 85 additions and 20 deletions

View file

@ -30,7 +30,7 @@ class ItemTestCase(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json(),
[{'uid': 1, 'description': '1', 'box': 'BOX', 'cid': self.box.cid, 'file': None,
'returned': False}])
'returned': False, 'event': self.event.slug}])
def test_members_with_file(self):
import base64
@ -40,7 +40,7 @@ class ItemTestCase(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json(),
[{'uid': 1, 'description': '1', 'box': 'BOX', 'cid': self.box.cid, 'file': file.hash,
'returned': False}])
'returned': False, 'event': self.event.slug}])
def test_multi_members(self):
Item.objects.create(container=self.box, event=self.event, description='1')
@ -55,7 +55,7 @@ class ItemTestCase(TestCase):
self.assertEqual(response.status_code, 201)
self.assertEqual(response.json(),
{'uid': 1, 'description': '1', 'box': 'BOX', 'cid': self.box.cid, 'file': None,
'returned': False})
'returned': False, 'event': self.event.slug})
self.assertEqual(len(Item.objects.all()), 1)
self.assertEqual(Item.objects.all()[0].uid, 1)
self.assertEqual(Item.objects.all()[0].description, '1')
@ -86,7 +86,7 @@ class ItemTestCase(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json(),
{'uid': 1, 'description': '2', 'box': 'BOX', 'cid': self.box.cid, 'file': None,
'returned': False})
'returned': False, 'event': self.event.slug})
self.assertEqual(len(Item.objects.all()), 1)
self.assertEqual(Item.objects.all()[0].uid, 1)
self.assertEqual(Item.objects.all()[0].description, '2')