fix: commit for postgres db_type before each TestAPI test

This commit is contained in:
Gavin D'souza 2021-06-14 13:44:20 +05:30
parent 3b310afc68
commit e5db89dd4d

View file

@ -39,6 +39,11 @@ class TestResourceAPI(unittest.TestCase):
for name in self.GENERATED_DOCUMENTS:
frappe.delete_doc_if_exists(self.DOCTYPE, name)
def setUp(self):
# commit to ensure consistency in session (postgres CI randomly fails)
if frappe.conf.db_type == "postgres":
frappe.db.commit()
@property
def sid(self):
if not getattr(self, "_sid", None):