Skip to content

Commit

Permalink
Feedback Tim
Browse files Browse the repository at this point in the history
  • Loading branch information
viggo-devries committed Oct 3, 2023
1 parent eb4a3ac commit 4edfa4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.test import TestCase
from oscar.core.loading import get_model

from oscar_odin.mappings import category
from oscar_odin.mappings import catalogue

Product = get_model("catalogue", "Product")

Expand All @@ -12,29 +12,29 @@ class TestProduct(TestCase):
def test_mapping__basic_model_to_resource(self):
product = Product.objects.first()

actual = category.product_to_resource(product)
actual = catalogue.product_to_resource(product)

self.assertEqual(product.title, actual.title)

def test_mapping__basic_product_with_out_of_stock_children(self):
product = Product.objects.get(id=1)

actual = category.product_to_resource(product)
actual = catalogue.product_to_resource(product)

self.assertEqual(product.title, actual.title)

def test_mapping__where_is_a_parent_product_do_not_include_children(self):
product = Product.objects.get(id=8)

actual = category.product_to_resource(product)
actual = catalogue.product_to_resource(product)

self.assertEqual(product.title, actual.title)
self.assertIsNone(actual.children)

def test_mapping__where_is_a_parent_product_include_children(self):
product = Product.objects.get(id=8)

actual = category.product_to_resource(product, include_children=True)
actual = catalogue.product_to_resource(product, include_children=True)

self.assertEqual(product.title, actual.title)
self.assertIsNotNone(actual.children)
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/test_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

class TestProduct(TestCase):
def test_init(self):
target = resources.category.Product()
target = resources.catalogue.Product()

self.assertIsNotNone(target)

0 comments on commit 4edfa4f

Please sign in to comment.