Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed May 1, 2023
1 parent 778ba69 commit db6d0e0
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,45 +178,6 @@ def test_period_closing_with_finance_book_entries(self):

self.assertEqual(pcv_gle, expected_gle)

def test_gl_entries_restrictions(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
frappe.db.sql("delete from `tabPeriod Closing Voucher` where company='Test PCV Company'")

company = create_company()
cost_center = create_cost_center("Test Cost Center 1")

self.make_period_closing_voucher(posting_date="2021-03-31")

jv1 = make_journal_entry(
posting_date="2021-03-15",
amount=400,
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center,
save=False,
)
jv1.company = company
jv1.save()

self.assertRaises(frappe.ValidationError, jv1.submit)
warehouse = frappe.db.get_value("Warehouse", {"company": company}, "name")

repost_doc = frappe.get_doc(
{
"doctype": "Repost Item Valuation",
"company": company,
"posting_date": "2020-03-15",
"based_on": "Item and Warehouse",
"item_code": "Test Item 1",
"warehouse": warehouse,
}
)

self.assertRaises(frappe.ValidationError, repost_doc.save)

repost_doc.posting_date = today()
repost_doc.save()

def make_period_closing_voucher(self, submit=True):
surplus_account = create_account()
cost_center = create_cost_center("Test Cost Center 1")
Expand Down

0 comments on commit db6d0e0

Please sign in to comment.