Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d6f112)
(cherry picked from commit 9b2b467)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed May 12, 2023
1 parent 762a46a commit 1783594
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def is_enqueue_action(self, force=False) -> bool:
if force:
return True

if frappe.flags.in_test:
return False

# If line items are more than 100 or record is older than 6 months
if len(self.items) > 100 or month_diff(nowdate(), self.posting_date) > 6:
return True
Expand Down
2 changes: 2 additions & 0 deletions erpnext/stock/doctype/stock_entry/test_stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ def test_negative_stock_reco(self):
self.assertRaises(frappe.ValidationError, sr_doc.submit)

def test_enqueue_action(self):
frappe.flags.in_test = False
item_code = "Test Enqueue Item - 001"
create_item(item_code=item_code, is_stock_item=1, valuation_rate=10)

Expand All @@ -1734,6 +1735,7 @@ def test_enqueue_action(self):
)

self.assertFalse(doc.is_enqueue_action())
frappe.flags.in_test = True


def make_serialized_item(**args):
Expand Down

0 comments on commit 1783594

Please sign in to comment.