Skip to content

Commit

Permalink
fix summary return
Browse files Browse the repository at this point in the history
  • Loading branch information
george-silva committed Aug 30, 2024
1 parent cfca24c commit 2926648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/planscape/impacts/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def generate_summary(
"type": p["type"],
"treated_stand_count": p["treated_stand_count"],
"area_acres": p["treated_stand_count"] * stand_area,
"stand_ids": p["stand_ids"],
}
for p in filter(
lambda p: p["project_area__id"] == project.id,
Expand Down
2 changes: 2 additions & 0 deletions src/planscape/impacts/tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def test_summary_is_returned_correctly(self):
)[0]
self.assertIn("prescriptions", proj_area_1)
self.assertEqual(len(proj_area_1["prescriptions"]), 1)
stands1 = proj_area_1["prescriptions"][0]["stand_ids"]
self.assertGreater(len(stands1), 0)
self.assertIn("prescriptions", proj_area_2)
self.assertEqual(len(proj_area_2["prescriptions"]), 1)

Expand Down

0 comments on commit 2926648

Please sign in to comment.