Skip to content

Commit e5b8433

Browse files
committed
Update tests
1 parent 0692934 commit e5b8433

File tree

2 files changed

+7
-68
lines changed

2 files changed

+7
-68
lines changed

backend/tests/apps/owasp/graphql/queries/project_health_metrics_test.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

backend/tests/apps/owasp/management/commands/owasp_update_project_health_metrics_scores_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from apps.owasp.models.project_health_metrics import ProjectHealthMetrics
99
from apps.owasp.models.project_health_requirements import ProjectHealthRequirements
1010

11-
EXPECTED_SCORE = 58.0
11+
EXPECTED_SCORE = 40.0
1212

1313

1414
class TestUpdateProjectHealthMetricsScoreCommand:
@@ -41,16 +41,16 @@ def test_handle_successful_update(self):
4141
"forks_count": (5, 6),
4242
"last_release_days": (5, 6),
4343
"last_commit_days": (5, 6),
44-
"open_issues_count": (5, 6),
44+
"open_issues_count": (7, 6),
4545
"open_pull_requests_count": (5, 6),
4646
"owasp_page_last_update_days": (5, 6),
4747
"last_pull_request_days": (5, 6),
4848
"recent_releases_count": (5, 6),
4949
"stars_count": (5, 6),
5050
"total_pull_requests_count": (5, 6),
5151
"total_releases_count": (5, 6),
52-
"unanswered_issues_count": (5, 6),
53-
"unassigned_issues_count": (5, 6),
52+
"unanswered_issues_count": (7, 6),
53+
"unassigned_issues_count": (7, 6),
5454
}
5555

5656
# Create mock metrics with test data
@@ -75,5 +75,8 @@ def test_handle_successful_update(self):
7575
# Check if score was calculated correctly
7676
self.mock_bulk_save.assert_called_once_with([mock_metric], fields=["score"])
7777
assert mock_metric.score == EXPECTED_SCORE
78+
assert mock_metric.has_long_open_issues is True
79+
assert mock_metric.has_long_unanswered_issues is True
80+
assert mock_metric.has_long_unassigned_issues is True
7881
assert "Updated projects health metrics score successfully." in self.stdout.getvalue()
7982
assert "Updating score for project: Test Project" in self.stdout.getvalue()

0 commit comments

Comments
 (0)