fixing test bug #168

This commit is contained in:
Cayo Puigdefabregas 2021-10-04 13:34:49 +02:00
parent b83bbe25a0
commit b02f9dfac5

View file

@ -2564,16 +2564,18 @@ def test_moveOnDocument_bug168(user: UserClient, user2: UserClient):
description = 'This is a good description' description = 'This is a good description'
request_moveOn = { request_moveOn = {
'type': 'MoveOnDocument', 'type': 'MoveOnDocument',
'weight': 15, 'weight': 4,
'container_from': tradedocument_from['id'], 'container_from': tradedocument_from['id'],
'container_to': id_hash, 'container_to': id_hash,
'description': description 'description': description
} }
doc, _ = user.post(res=models.Action, data=request_moveOn) doc, _ = user.post(res=models.Action, data=request_moveOn)
trade = models.Trade.query.one()
trade_document1 = TradeDocument.query.filter_by(id=tradedocument_from['id']).one()
trade_document2 = TradeDocument.query.filter_by(id=tradedocument_to['id']).one()
assert trade_document1.total_weight == 150.0
assert trade_document2.total_weight == 4.0
assert trade_document1.trading == 'Confirm'
assert trade_document2.trading == None
assert doc['weight'] == request_moveOn['weight']
assert doc['container_from']['id'] == tradedocument_from['id']
assert doc['container_to']['id'] == tradedocument_to['id']
import pdb; pdb.set_trace()
tradedocument, _ = user.delete(res=TradeDocument, item=tradedocument_to['id']) tradedocument, _ = user.delete(res=TradeDocument, item=tradedocument_to['id'])