From 7dbb696de52f102a0839b1a79e0579a6c44bd05f Mon Sep 17 00:00:00 2001 From: Tim Savage Date: Mon, 23 Oct 2023 00:06:49 +1100 Subject: [PATCH] Add an initial test --- tests/mappings/test_order.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/mappings/test_order.py b/tests/mappings/test_order.py index 8baa552..d00b73f 100644 --- a/tests/mappings/test_order.py +++ b/tests/mappings/test_order.py @@ -1,8 +1,24 @@ from django.test import TestCase from oscar.core.loading import get_model +from oscar_odin.mappings import order + Order = get_model("order", "Order") class TestOrder(TestCase): - pass + fixtures = [ + "oscar_odin/auth", + "oscar_odin/catalogue", + "oscar_odin/partner", + "oscar_odin/offer", + "oscar_odin/address", + "oscar_odin/order", + ] + + def test_mapping__basic_model_to_resource(self): + order_model = Order.objects.first() + + actual = order.order_to_resource(order_model) + + self.assertEqual(order_model.number, actual.number)