test: repost queue progress
This commit is contained in:
parent
ecdb49314f
commit
8f519545b0
@ -186,3 +186,10 @@ class TestRepostItemValuation(FrappeTestCase):
|
|||||||
riv.db_set("status", "Skipped")
|
riv.db_set("status", "Skipped")
|
||||||
riv.reload()
|
riv.reload()
|
||||||
riv.cancel() # it should cancel now
|
riv.cancel() # it should cancel now
|
||||||
|
|
||||||
|
def test_queue_progress_serialization(self):
|
||||||
|
# Make sure set/tuple -> list behaviour is retained.
|
||||||
|
self.assertEqual(
|
||||||
|
[["a", "b"], ["c", "d"]],
|
||||||
|
sorted(frappe.parse_json(frappe.as_json(set([("a", "b"), ("c", "d")])))),
|
||||||
|
)
|
||||||
|
@ -272,8 +272,6 @@ def validate_item_warehouse(args):
|
|||||||
def update_args_in_repost_item_valuation(
|
def update_args_in_repost_item_valuation(
|
||||||
doc, index, args, distinct_item_warehouses, affected_transactions
|
doc, index, args, distinct_item_warehouses, affected_transactions
|
||||||
):
|
):
|
||||||
affected_transactions_list = [list(transaction) for transaction in affected_transactions]
|
|
||||||
|
|
||||||
doc.db_set(
|
doc.db_set(
|
||||||
{
|
{
|
||||||
"items_to_be_repost": json.dumps(args, default=str),
|
"items_to_be_repost": json.dumps(args, default=str),
|
||||||
@ -281,7 +279,7 @@ def update_args_in_repost_item_valuation(
|
|||||||
{str(k): v for k, v in distinct_item_warehouses.items()}, default=str
|
{str(k): v for k, v in distinct_item_warehouses.items()}, default=str
|
||||||
),
|
),
|
||||||
"current_index": index,
|
"current_index": index,
|
||||||
"affected_transactions": json.dumps(affected_transactions_list),
|
"affected_transactions": frappe.as_json(affected_transactions),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user