test: add test for workspace name conflict with existing DocType

This commit is contained in:
KerollesFathy 2026-03-11 00:44:09 +00:00
parent b969282e8f
commit 929fb66ac6

View file

@ -13,6 +13,15 @@ class TestWorkspace(IntegrationTestCase):
frappe.db.delete("DocType", {"module": "Test Module"})
frappe.delete_doc("Module Def", "Test Module")
def test_workspace_conflicts_with_existing_doctype(self):
"""Workspace name should not conflict with existing DocType names."""
create_doctype("Test", "Test Module")
workspace = create_workspace(name="Test", label="Test", public=1, title="Test")
with self.assertRaises(frappe.NameError):
workspace.insert()
# TODO: FIX ME - flaky test!!!
# def test_workspace_with_cards_specific_to_a_country(self):
# workspace = create_workspace()
@ -65,6 +74,8 @@ def create_workspace(**args):
workspace.category = args.category or "Modules"
workspace.is_standard = args.is_standard or 1
workspace.module = "Test Module"
workspace.public = args.public or 0
workspace.title = args.title or "Test Workspace"
return workspace