chore: reuse doc object in test_pick_list_grouping_before_print (backport #33636) (#33638)

chore: reuse doc object in test_pick_list_grouping_before_print (#33636)

(cherry picked from commit e22d56484d)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
This commit is contained in:
mergify[bot]
2023-01-13 01:33:46 +05:30
committed by GitHub
parent 7dcf0f0866
commit f3b6b4609e

View File

@@ -447,16 +447,7 @@ class TestPickList(FrappeTestCase):
self.assertEqual(len(pl.locations), 4)
# grouping should halve the number of items
pl = frappe.get_doc(
doctype="Pick List",
group_same_items=True,
locations=[
_dict(item_code="A", warehouse="X", qty=5, picked_qty=1),
_dict(item_code="B", warehouse="Y", qty=4, picked_qty=2),
_dict(item_code="A", warehouse="X", qty=3, picked_qty=2),
_dict(item_code="B", warehouse="Y", qty=2, picked_qty=2),
],
)
pl.group_same_items = True
pl.before_print()
self.assertEqual(len(pl.locations), 2)