This commit is contained in:
parent
bd967e1d9e
commit
2c59f6d971
|
|
@ -27,7 +27,7 @@ def test():
|
|||
}
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-brands', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-brands', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'characteristics': {
|
||||
1: {
|
||||
'id': 'chtitle_' + id_generator(16),
|
||||
'title': id_generator(16),
|
||||
},
|
||||
2: {
|
||||
'id': 'chtitle_' + id_generator(16),
|
||||
'title': id_generator(16),
|
||||
}
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-characteristics', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
|
|
@ -25,7 +25,7 @@ def test():
|
|||
}
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-groups', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-groups', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ def test():
|
|||
},
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-models', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-models', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ def test():
|
|||
'id': id,
|
||||
'file_name': id_generator(16) + '.jpg',
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/picture', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/picture', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def test():
|
|||
3: get_data()
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-products', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-products', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'values': {
|
||||
1: {
|
||||
'id': 'chvalue_' + id_generator(16),
|
||||
'title': id_generator(16),
|
||||
},
|
||||
2: {
|
||||
'id': 'chvalue_' + id_generator(16),
|
||||
'title': id_generator(16),
|
||||
}
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-values', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
2
brand.py
2
brand.py
|
|
@ -18,7 +18,7 @@ def test():
|
|||
'picture_id': 'picture_75g36ayxk9yvl8lz',
|
||||
'type': 10,
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/brand', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/brand', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
id = 'chtitle_' + id_generator(16)
|
||||
data = {
|
||||
'id': id,
|
||||
'title': 'test',
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/characteristic', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'to': 1742974769,
|
||||
'from': 1742974584,
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/export-orders', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'from': 0,
|
||||
'to': 1000000000,
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/export-users', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
2
group.py
2
group.py
|
|
@ -16,7 +16,7 @@ def test():
|
|||
'url': id_generator(16),
|
||||
'picture_src': id_generator(16) + '.jpg',
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/group', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/group', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'orders': [
|
||||
{
|
||||
'id': 'order_002d2542a1d14de6bc4715fdad05e683',
|
||||
'stage': 20,
|
||||
}
|
||||
],
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/import-orders', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
data = {
|
||||
'users': [
|
||||
{
|
||||
'id': 'user_003afe5e7be73b786b6250a27685913e',
|
||||
'status': 10,
|
||||
}
|
||||
]
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/import-users', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
6
model.py
6
model.py
|
|
@ -16,10 +16,10 @@ def test():
|
|||
'url': id_generator(16),
|
||||
'year_from': 1999,
|
||||
'year_to': 2008,
|
||||
'brand_id': 'brand_rbmjh7flxc9zgr0r',
|
||||
'picture_id': 'picture_75g36ayxk9yvl8lz',
|
||||
'brand_id': 'brand_rbmjh7flxc9zgr0r', # Смотри brand.py,
|
||||
'picture_id': 'picture_75g36ayxk9yvl8lz', # Смотри picture.py,
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/model', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/model', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ def test():
|
|||
}
|
||||
}
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-pictures', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-pictures', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
23
product.py
23
product.py
|
|
@ -13,25 +13,32 @@ def test():
|
|||
data = {
|
||||
'id': id,
|
||||
'name': id_generator(16),
|
||||
'tag': id_generator(16),
|
||||
'price': 1999,
|
||||
'old_price': 2008,
|
||||
'quantity': 10,
|
||||
'model_id': 'model_rxbvlglyao59ef2s',
|
||||
'group_id': 'group_10c8f7l3lu7ydxhk',
|
||||
'count': 0,
|
||||
'model_id': 'model_006f52e9102a8d3be2fe5614f42ba989' # Смотри model.py,
|
||||
'group_id': 'group_1679091c5a880faf6fb5e6087eb1b2dc', # Смотри group.py,
|
||||
'factory_num': '123qbc',
|
||||
'vendor_num': '123qbc',
|
||||
'oem': '123qbc',
|
||||
'comment': '123qbc',
|
||||
'is_new': 0,
|
||||
'is_original': 1,
|
||||
'pictures_ids': ['picture_75g36ayxk9yvl8lz', 'picture_bpjunqpy94k36got', 'picture_nxyrvt9hggw2rff2', 'picture_y04kt98ernepnh1y',],
|
||||
'options': {
|
||||
'left': 1,
|
||||
'right': 0,
|
||||
'pictures_ids': [ # Смотри picture.py,
|
||||
'picture_00003e3b9e5336685200ae85d21b4f5e',
|
||||
'picture_000053b1e684c9e7ea73727b2238ce18',
|
||||
'picture_0001261e2060303a06ba6c64d676d639',
|
||||
'picture_00029153d12ae1c9abe59c17ff2e0895',
|
||||
],
|
||||
'characteristics': [
|
||||
{
|
||||
'key': 'chtitle_b28354b543375bfa94dabaeda722927f', # Смотри characteristic.py
|
||||
'value': 'chvalue_a6105c0a611b41b08f1209506350279e', # Смотри value.py
|
||||
}
|
||||
]
|
||||
}
|
||||
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/product', json=data, auth=('qwe', 'qwe'))
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/product', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
from requests import Request, Session
|
||||
import hashlib
|
||||
import string
|
||||
import random
|
||||
|
||||
s = Session()
|
||||
|
||||
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
def test():
|
||||
id = 'chvalue_' + id_generator(16)
|
||||
data = {
|
||||
'id': id,
|
||||
'title': 'test',
|
||||
}
|
||||
req = Request('POST', 'http://localhost/api/v1.0/show-case/value', json=data, auth=('qwe', 'qwe'))
|
||||
prepped = req.prepare()
|
||||
resp = s.send(prepped)
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
|
||||
test()
|
||||
Loading…
Reference in New Issue