work on product csv loading

This commit is contained in:
Sam
2021-03-02 13:53:48 +00:00
parent 8bae68907e
commit 4a0a9c3788
3 changed files with 28 additions and 23 deletions

View File

@@ -421,6 +421,9 @@ class LoadCoopProductsTestCase(APITestCase):
# create company
company = CompanyFactory(creator=self.user)
# link with user
self.user.company = company
self.user.save()
# read csv file
files = {'csv_file': open(self.csv_path,'rt')}
@@ -431,8 +434,9 @@ class LoadCoopProductsTestCase(APITestCase):
# send in request
response = self.client.post(self.endpoint, files)
import ipdb; ipdb.set_trace()
# check re sponse
# check response
self.assertEqual(response.status_code, 200)
# check for object creation
self.assertEquals(5, self.model.objects.count())