serializser working for tags but not single tags

This commit is contained in:
Sam
2021-01-25 12:52:48 +00:00
parent c3c9f54c54
commit d7fdacee7a
3 changed files with 50 additions and 11 deletions

View File

@@ -116,9 +116,9 @@ class ProductViewSetTest(APITestCase):
'update_date': datetime.datetime.now().isoformat()+'Z',
'discount': '0.05',
'stock': 22,
# tags = models.ManyToMany(Tag, null=True, blank=True )
# category = models.ForeignKey(Tag, null=true) # main tag category
# attributes = models.ManyToMany(Tag, null=True, blank=True )
'tags': ['tag1, tag2'],
# 'category': 'MayorTagCategory',
# 'attributes': ['color/red', 'size/xxl'],
'identifiers': '34rf34f43c43',
}
@@ -128,6 +128,7 @@ class ProductViewSetTest(APITestCase):
# Query endpoint
response = self.client.post(self.endpoint, data=data, format='json')
import ipdb; ipdb.set_trace()
# Assert endpoint returns created status
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
@@ -160,9 +161,9 @@ class ProductViewSetTest(APITestCase):
'update_date': datetime.datetime.now().isoformat()+'Z',
'discount': '0.05',
'stock': 22,
# tags = models.ManyToMany(Tag, null=True, blank=True )
# category = models.ForeignKey(Tag, null=true) # main tag category
# attributes = models.ManyToMany(Tag, null=True, blank=True )
'tags': ['tag1x, tag2x'],
'category': 'MayorTagCategory2',
'attributes': ['color/blue', 'size/m'],
'identifiers': '34rf34f43c43',
}