Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spp_metric/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion spp_metric/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions spp_metric/readme/HISTORY.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions spp_metric/tests/test_metric_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)

Expand All @@ -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",
}
)

Expand Down
10 changes: 6 additions & 4 deletions spp_metric/tests/test_metric_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading