File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
spp_metrics_services/tests Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -478,16 +478,17 @@ def test_constraint_expression_type_without_expression(self):
478478 )
479479
480480 def test_constraint_unique_name(self):
481- """Duplicate dimension name raises an error."""
482- with self.assertRaises(ValidationError):
483- self.dim_model.create(
484- {
485- "name": "test_is_group", # already exists
486- "label": "Duplicate",
487- "dimension_type": "field",
488- "field_path": "name",
489- }
490- )
481+ """Duplicate dimension name raises an error (SQL unique constraint)."""
482+ with self.assertRaises(Exception): # noqa: B017
483+ with self.env.cr.savepoint():
484+ self.dim_model.create(
485+ {
486+ "name": "test_is_group", # already exists
487+ "label": "Duplicate",
488+ "dimension_type": "field",
489+ "field_path": "name",
490+ }
491+ )
491492
492493 # -------------------------------------------------------------------------
493494 # write() and unlink() cache invalidation
You can’t perform that action at this time.
0 commit comments