Skip to content

Commit

Permalink
Add an initial test
Browse files Browse the repository at this point in the history
  • Loading branch information
timsavage committed Oct 22, 2023
1 parent e72d2b2 commit 7dbb696
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/mappings/test_order.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 7dbb696

Please sign in to comment.