-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |