everythin working except for creation product insance with category
This commit is contained in:
@@ -118,7 +118,7 @@ class ProductViewSetTest(APITestCase):
|
||||
'discount': '0.05',
|
||||
'stock': 22,
|
||||
'tags': ['tag1, tag2'],
|
||||
# 'category': 'MayorTagCategory',
|
||||
# 'category': '',
|
||||
'attributes': ['color/red', 'size/xxl'],
|
||||
'identifiers': '34rf34f43c43',
|
||||
}
|
||||
@@ -129,6 +129,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)
|
||||
|
||||
@@ -162,7 +163,7 @@ class ProductViewSetTest(APITestCase):
|
||||
'discount': '0.05',
|
||||
'stock': 22,
|
||||
'tags': ['tag1x, tag2x'],
|
||||
# 'category': 'MayorTagCategory2',
|
||||
'category': 'MayorTagCategory2',
|
||||
'attributes': ['color/blue', 'size/m'],
|
||||
'identifiers': '34rf34f43c43',
|
||||
}
|
||||
@@ -174,7 +175,6 @@ class ProductViewSetTest(APITestCase):
|
||||
# Query endpoint
|
||||
url = self.endpoint + f'{instance.pk}/'
|
||||
response = self.client.put(url, data, format='json')
|
||||
import ipdb; ipdb.set_trace()
|
||||
# Assert endpoint returns OK code
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user