mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-07 12:33:19 +00:00
fix: test cases related to default letterhead change
(cherry picked from commit 8a2cb96c2a)
This commit is contained in:
@@ -18,8 +18,19 @@ class TestProcessStatementOfAccounts(AccountsTestMixin, IntegrationTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
letterhead = frappe.get_doc("Letter Head", "Company Letterhead - Grey")
|
||||
letterhead.is_default = 0
|
||||
letterhead.save()
|
||||
cls.enterClassContext(cls.change_settings("Selling Settings", validate_selling_price=0))
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
super().tearDownClass()
|
||||
letterhead = frappe.get_doc("Letter Head", "Company Letterhead - Grey")
|
||||
letterhead.is_default = 1
|
||||
letterhead.save()
|
||||
frappe.db.commit() # nosemgrep
|
||||
|
||||
def setUp(self):
|
||||
self.create_company()
|
||||
self.create_customer()
|
||||
|
||||
@@ -316,6 +316,9 @@ def set_default_print_formats():
|
||||
if frappe.get_meta(doctype).default_print_format:
|
||||
continue
|
||||
|
||||
if not frappe.db.exists("Print Format", print_format):
|
||||
continue
|
||||
|
||||
frappe.make_property_setter(
|
||||
{
|
||||
"doctype": doctype,
|
||||
@@ -345,7 +348,7 @@ def create_letter_head():
|
||||
"letter_head_name": name,
|
||||
"source": "HTML",
|
||||
"content": content,
|
||||
"is_default": 1 if name == "Company Letterhead" else 0,
|
||||
"is_default": 1 if name == "Company Letterhead - Grey" else 0,
|
||||
}
|
||||
)
|
||||
doc.insert(ignore_permissions=True)
|
||||
|
||||
Reference in New Issue
Block a user