diff --git a/spp_metric/README.rst b/spp_metric/README.rst index 3af938bee..c9a57ff85 100644 --- a/spp_metric/README.rst +++ b/spp_metric/README.rst @@ -93,6 +93,18 @@ Dependencies Changelog ========= +19.0.2.0.1 +~~~~~~~~~~ + +- test(metric): make the tests hold on a database that has + ``spp_indicator`` installed, the only place they run at all (they skip + without ``spp.indicator``, so they had never executed before the + full-stack CI). The base-model tests create their ``spp.cel.variable`` + with the fields the model has — ``cel_expression`` and the required + ``cel_accessor``, no ``label``, which only ``spp_studio`` adds — and + the category test uses a code no data file claims, since + ``spp_indicator`` seeds ``demographics``. No behaviour change (#443) + 19.0.2.0.0 ~~~~~~~~~~ diff --git a/spp_metric/__manifest__.py b/spp_metric/__manifest__.py index 7f6d2b0c3..73c8dd1a3 100644 --- a/spp_metric/__manifest__.py +++ b/spp_metric/__manifest__.py @@ -3,7 +3,7 @@ "name": "OpenSPP Metric", "summary": "Unified metric foundation for indicators and simulations", "category": "OpenSPP", - "version": "19.0.2.0.0", + "version": "19.0.2.0.1", "sequence": 1, "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/OpenSPP2", diff --git a/spp_metric/readme/HISTORY.md b/spp_metric/readme/HISTORY.md index 4aaf9afef..cb1ba8117 100644 --- a/spp_metric/readme/HISTORY.md +++ b/spp_metric/readme/HISTORY.md @@ -1,3 +1,7 @@ +### 19.0.2.0.1 + +- test(metric): make the tests hold on a database that has `spp_indicator` installed, the only place they run at all (they skip without `spp.indicator`, so they had never executed before the full-stack CI). The base-model tests create their `spp.cel.variable` with the fields the model has — `cel_expression` and the required `cel_accessor`, no `label`, which only `spp_studio` adds — and the category test uses a code no data file claims, since `spp_indicator` seeds `demographics`. No behaviour change (#443) + ### 19.0.2.0.0 - Initial migration to OpenSPP2 diff --git a/spp_metric/tests/test_metric_base.py b/spp_metric/tests/test_metric_base.py index 68b89b7ca..553420510 100644 --- a/spp_metric/tests/test_metric_base.py +++ b/spp_metric/tests/test_metric_base.py @@ -75,10 +75,10 @@ def test_metric_base_default_values(self): variable = self.env["spp.cel.variable"].create( { "name": "test_var", - "label": "Test Variable", + "cel_accessor": "test_var", "source_type": "computed", "state": "active", - "expression": "1 + 1", + "cel_expression": "1 + 1", } ) @@ -104,10 +104,10 @@ def test_metric_base_category_assignment(self): variable = self.env["spp.cel.variable"].create( { "name": "test_var_2", - "label": "Test Variable 2", + "cel_accessor": "test_var_2", "source_type": "computed", "state": "active", - "expression": "2 + 2", + "cel_expression": "2 + 2", } ) diff --git a/spp_metric/tests/test_metric_category.py b/spp_metric/tests/test_metric_category.py index 523ca610b..5a7e97744 100644 --- a/spp_metric/tests/test_metric_category.py +++ b/spp_metric/tests/test_metric_category.py @@ -12,15 +12,17 @@ def test_create_category(self): """Test creating a metric category.""" category = self.env["spp.metric.category"].create( { - "name": "Demographics", - "code": "demographics", + "name": "Test Demographics", + # A code no data file claims: spp_indicator seeds "demographics" + # and the unique constraint would refuse a second row. + "code": "test_demographics", "description": "Demographic statistics", "sequence": 10, } ) - self.assertEqual(category.name, "Demographics") - self.assertEqual(category.code, "demographics") + self.assertEqual(category.name, "Test Demographics") + self.assertEqual(category.code, "test_demographics") self.assertTrue(category.active) def test_category_code_unique(self):