Merge pull request #26347 from ruchamahabal/fix-flaky-sla-test

fix: flaky SLA test
This commit is contained in:
Nabin Hait 2021-07-06 21:50:42 +05:30 committed by GitHub
commit d45ebaf61c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,11 +81,9 @@ class TestServiceLevelAgreement(unittest.TestCase):
# check SLA custom fields created for leads
sla_fields = get_service_level_agreement_fields()
frappe.clear_cache(doctype=doctype)
meta = frappe.get_meta(doctype, cached=False)
for field in sla_fields:
self.assertTrue(meta.has_field(field.get("fieldname")))
self.assertTrue(frappe.db.exists("Custom Field", {"dt": doctype, "fieldname": field.get("fieldname")}))
def test_docfield_creation_for_sla_on_custom_dt(self):
doctype = create_custom_doctype()
@ -103,10 +101,9 @@ class TestServiceLevelAgreement(unittest.TestCase):
# check SLA docfields created
sla_fields = get_service_level_agreement_fields()
meta = frappe.get_meta(doctype.name, cached=False)
for field in sla_fields:
self.assertTrue(meta.has_field(field.get("fieldname")))
self.assertTrue(frappe.db.exists("DocField", {"fieldname": field.get("fieldname"), "parent": doctype.name}))
def test_sla_application(self):
# Default Service Level Agreement