more tests for tagging serializer

This commit is contained in:
Sam
2021-01-25 13:51:38 +00:00
parent d7fdacee7a
commit 8059cd3667
4 changed files with 69 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ from products.models import Product
from utils.tag_serializers import SingleTagSerializerField, CustomTagSerializer
class ProductSerializer(CustomTagSerializer, serializers.ModelSerializer):
class ProductSerializer(CustomTagSerializer):
tags = TagListSerializerField(required=False)
category = SingleTagSerializerField(required=False) # main tag category

View File

@@ -118,7 +118,7 @@ class ProductViewSetTest(APITestCase):
'stock': 22,
'tags': ['tag1, tag2'],
# 'category': 'MayorTagCategory',
# 'attributes': ['color/red', 'size/xxl'],
'attributes': ['color/red', 'size/xxl'],
'identifiers': '34rf34f43c43',
}