Пример #1
0
def cart_id(url, token):
    res = jpost(url + "/carts", token)
    return res.status_code == 200 and res.json()["cart_id"]
Пример #2
0
 def _f(token, _items=None):
     res = jpost(url + "/carts", token)
     cart_id = res.json()["cart_id"]
     jpatch(url + "/carts/%s" % cart_id, token, _items or items)
     return jpost(url + "/orders", token, {"cart_id": cart_id})
Пример #3
0
def cart_id(url, token):
    res = jpost(url + "/carts", token)
    return res.status_code == 200 and res.json()["cart_id"]
Пример #4
0
def test_new_carts(url, token):
    res = jpost(url + "/carts", token)
    assert res.status_code == 200
    assert len(res.json().get("cart_id", "")) > 0
Пример #5
0
 def _f(token, _items=None):
     res = jpost(url + "/carts", token)
     cart_id = res.json()["cart_id"]
     jpatch(url + "/carts/%s" % cart_id, token, _items or items)
     return jpost(url + "/orders", token, {"cart_id": cart_id})