updated to readme
This commit is contained in:
31
README.md
31
README.md
@@ -7,6 +7,7 @@ This README aims to document functionality of backend as well as required steps
|
|||||||
- [First Steps](#first-steps)
|
- [First Steps](#first-steps)
|
||||||
- [Location Data](#location-data)
|
- [Location Data](#location-data)
|
||||||
- [Endpoints](#endpoints)
|
- [Endpoints](#endpoints)
|
||||||
|
- [Data Load](#data-load)
|
||||||
|
|
||||||
## First Steps
|
## First Steps
|
||||||
|
|
||||||
@@ -77,14 +78,6 @@ Update user profile:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### COOP and Managin User Data Load
|
|
||||||
|
|
||||||
For massive load of data from COOPs and the managing user.
|
|
||||||
|
|
||||||
CSV headers: `email,cif,nombre-coop,nombre-corto,url,es-tienda`
|
|
||||||
|
|
||||||
Only admin users have access to endoint
|
|
||||||
|
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
@@ -151,3 +144,25 @@ Location ednpoints:
|
|||||||
- `/api/v1/regions/`
|
- `/api/v1/regions/`
|
||||||
- `/api/v1/provinces/`
|
- `/api/v1/provinces/`
|
||||||
- `/api/v1/cities/`
|
- `/api/v1/cities/`
|
||||||
|
|
||||||
|
|
||||||
|
## Load Data
|
||||||
|
|
||||||
|
|
||||||
|
### COOP and Managing User Data Load
|
||||||
|
|
||||||
|
For massive load of data from COOPs and the managing user.
|
||||||
|
|
||||||
|
CSV headers: `email,cif,nombre-coop,nombre-corto,url,es-tienda`
|
||||||
|
|
||||||
|
Only admin users have access to endoint
|
||||||
|
|
||||||
|
### Product Data Load
|
||||||
|
|
||||||
|
Endpoint: `/api/v1/load_products/`
|
||||||
|
|
||||||
|
For massive load of product data.
|
||||||
|
|
||||||
|
CSV headers: `id,nombre-producto,descripcion,imagen,url,precio,gastos-envio,cond-envio,descuento,stock,tags,categoria,identificadores`
|
||||||
|
|
||||||
|
Only admin users have access to endoint
|
||||||
|
|||||||
@@ -387,7 +387,6 @@ class LoadCoopManagerTestCase(APITestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Tests setup
|
"""Tests setup
|
||||||
"""
|
"""
|
||||||
self.url = 'http://127.0.0.1:8000/api/v1/load_coops/'
|
|
||||||
self.endpoint = '/api/v1/load_coops/'
|
self.endpoint = '/api/v1/load_coops/'
|
||||||
self.user_factory = factories.CustomUserFactory
|
self.user_factory = factories.CustomUserFactory
|
||||||
self.user_model = models.CustomUser
|
self.user_model = models.CustomUser
|
||||||
@@ -417,7 +416,7 @@ class LoadCoopManagerTestCase(APITestCase):
|
|||||||
self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {token['access']}")
|
self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {token['access']}")
|
||||||
|
|
||||||
# send in request
|
# send in request
|
||||||
response = self.client.post(self.url, files)
|
response = self.client.post(self.endpoint, files)
|
||||||
|
|
||||||
# check re sponse
|
# check re sponse
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
@@ -437,7 +436,7 @@ class LoadCoopManagerTestCase(APITestCase):
|
|||||||
self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {token['access']}")
|
self.client.credentials(HTTP_AUTHORIZATION=f"Bearer {token['access']}")
|
||||||
|
|
||||||
# send in request
|
# send in request
|
||||||
response = self.client.post(self.url, files)
|
response = self.client.post(self.endpoint, files)
|
||||||
|
|
||||||
# check response
|
# check response
|
||||||
self.assertEqual(response.status_code, 403)
|
self.assertEqual(response.status_code, 403)
|
||||||
@@ -453,7 +452,7 @@ class LoadCoopManagerTestCase(APITestCase):
|
|||||||
files = {'csv_file': open(self.csv_path,'r')}
|
files = {'csv_file': open(self.csv_path,'r')}
|
||||||
|
|
||||||
# send in request
|
# send in request
|
||||||
response = self.client.post(self.url, files)
|
response = self.client.post(self.endpoint, files)
|
||||||
|
|
||||||
# check response
|
# check response
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
|
|||||||
Reference in New Issue
Block a user