mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Add item ordering test
This commit is contained in:
@@ -182,4 +182,15 @@ class EventItemTestCase(TestCase):
|
||||
self.assertEqual(item.total_cost, 2.50)
|
||||
|
||||
item.quantity = 4
|
||||
self.assertEqual(item.total_cost, 10.00)
|
||||
self.assertEqual(item.total_cost, 10.00)
|
||||
|
||||
# need to tidy up
|
||||
item.delete()
|
||||
|
||||
def test_item_order(self):
|
||||
i1 = models.EventItem.objects.create(event=self.e1, name="TI I1", quantity=1, cost=1.00, order=1)
|
||||
i2 = models.EventItem.objects.create(event=self.e1, name="TI I2", quantity=1, cost=1.00, order=2)
|
||||
|
||||
items = self.e1.items.all()
|
||||
self.assertListEqual([i1, i2], list(items))
|
||||
|
||||
Reference in New Issue
Block a user