Skip to content

Commit

Permalink
Rename property completion_rate to completion_rate_calculated for cla…
Browse files Browse the repository at this point in the history
…rification
  • Loading branch information
raphodn committed Nov 28, 2023
1 parent 7b55872 commit 086705d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lemarche/siaes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def source_display(self):
return "l'ASP"

@property
def completion_percent(self):
def completion_rate_calculated(self):
score, total = 0, 0
for key, value in siae_constants.SIAE_COMPLETION_SCORE_GRID.items():
completion_item_kind = value[siae_constants.COMPLETION_KIND_KEY]
Expand Down
8 changes: 4 additions & 4 deletions lemarche/siaes/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_is_missing_contact_property(self):

def test_is_missing_content_property(self):
siae_missing: Siae = SiaeFactory(name="Ma boite", contact_email="")
score_completion_before = siae_missing.completion_percent
score_completion_before = siae_missing.completion_rate_calculated
self.assertTrue(siae_missing.is_missing_content)
siae_full: Siae = SiaeFactory(
name="Ma boite",
Expand All @@ -143,15 +143,15 @@ def test_is_missing_content_property(self):
contact_phone="0000000000",
description="test",
)
self.assertTrue(score_completion_before < siae_full.completion_percent)
score_completion_before = siae_full.completion_percent
self.assertTrue(score_completion_before < siae_full.completion_rate_calculated)
score_completion_before = siae_full.completion_rate_calculated
sector = SectorFactory()
siae_full.sectors.add(sector)
SiaeOfferFactory(siae=siae_full)
SiaeLabelOldFactory(siae=siae_full)
siae_full.save() # to update stats
self.assertFalse(siae_full.is_missing_content)
self.assertTrue(score_completion_before < siae_full.completion_percent)
self.assertTrue(score_completion_before < siae_full.completion_rate_calculated)

siae_full_2: Siae = SiaeFactory(
name="Ma boite",
Expand Down
2 changes: 1 addition & 1 deletion lemarche/templates/dashboard/_siae_tab_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</span>
<h2 class="mb-0">{{ siae.name_display }}</h2>
</div>
{% include "includes/_completion_progress_bar.html" with completion_percent=siae.completion_percent %}
{% include "includes/_completion_progress_bar.html" with completion_percent=siae.completion_rate_calculated %}
</div>
<div class="col-12 col-md-auto ml-auto d-flex flex-column">
<a href="{% url 'dashboard_siaes:siae_edit' siae.slug %}" id="dashboard-siae-edit-btn" class="btn btn-important btn-sm btn-ico mb-2">
Expand Down

0 comments on commit 086705d

Please sign in to comment.