Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viggo-devries committed Dec 20, 2023
1 parent 796af62 commit 6d9f923
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion oscar_odin/mappings/_model_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ModelMapping(MappingBase, metaclass=ModelMappingMeta):
def create_object(self, **field_values):
"""Create a new product model."""
attribute_values = field_values.pop("attributes", [])
print(self.many_to_many_fields)

m2m_related_values = {
field: field_values.pop(field.name)
for field in self.many_to_many_fields
Expand Down
3 changes: 0 additions & 3 deletions oscar_odin/resources/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ class Product(OscarCatalogue):
product_class: Optional[ProductClass] = None
attributes: Dict[str, Any]
categories: List[Category]
# children: Optional[List["Product"]] = odin.ListOf.delayed(
# lambda: Product, null=True
# )

date_created: datetime
date_updated: datetime
9 changes: 0 additions & 9 deletions tests/mappings/test_catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,3 @@ def test_product_to_resource__where_is_a_parent_product_do_not_include_children(

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

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

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

self.assertEqual(product.title, actual.title)
self.assertIsNotNone(actual.children)
self.assertEqual(3, len(actual.children))
1 change: 0 additions & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"widget_tweaks",
"haystack",
"treebeard",
"sorl.thumbnail",
"django_tables2",
# Oscar apps
"oscar.config.Shop",
Expand Down

0 comments on commit 6d9f923

Please sign in to comment.