fix: remove screenshot placeholders from reports
This commit is contained in:
1 parent
4183d99376
commit
cfdbdc2a07
2 files changed
+4
-16
No files matched your search
@@ -17,11 +17,6 @@ def _number(value: float | int) -> str:
|
|||||||
|
|
||||||
def render_coaching(session: CoachingSession, result: CoachingResult) -> str:
|
def render_coaching(session: CoachingSession, result: CoachingResult) -> str:
|
||||||
hashtag = "#лазание" if session.skill == "ЛУ" else "#зоркость"
|
hashtag = "#лазание" if session.skill == "ЛУ" else "#зоркость"
|
||||||
reminder = (
|
|
||||||
"Не забудьте приложить скриншот истории с подтверждением махинации."
|
|
||||||
if session.kitten_independence == "несамостоятельно"
|
|
||||||
else ""
|
|
||||||
)
|
|
||||||
lines = [
|
lines = [
|
||||||
hashtag,
|
hashtag,
|
||||||
f"{session.escort_name} [{session.escort_id}], помог(-ла) {session.kitten_name} [{session.kitten_id}] "
|
f"{session.escort_name} [{session.escort_id}], помог(-ла) {session.kitten_name} [{session.kitten_id}] "
|
||||||
@@ -31,12 +26,6 @@ def render_coaching(session: CoachingSession, result: CoachingResult) -> str:
|
|||||||
f"Баллы белки: {_number(result.escort_points)} баллы.",
|
f"Баллы белки: {_number(result.escort_points)} баллы.",
|
||||||
f"Баллы бельчонка: {_number(result.kitten_points)} баллы.",
|
f"Баллы бельчонка: {_number(result.kitten_points)} баллы.",
|
||||||
]
|
]
|
||||||
lines.append(
|
|
||||||
"\n[Скриншот Игровой с вашим персонажем на Небесном Дубе или Тропе Смелости/лазалках, "
|
|
||||||
"временем и датой — начало и конец]"
|
|
||||||
)
|
|
||||||
if reminder:
|
|
||||||
lines.append(reminder)
|
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
@@ -66,5 +55,4 @@ def render_inspection(report: InspectionReport) -> str:
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
lines.append("0")
|
lines.append("0")
|
||||||
lines.append("Скриншот истории и рта.")
|
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
+4
-4
@@ -71,7 +71,7 @@ class CalculationTests(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class ReportTests(unittest.TestCase):
|
class ReportTests(unittest.TestCase):
|
||||||
def test_coaching_report_contains_new_fields_and_reminder(self):
|
def test_coaching_report_contains_new_fields_without_screenshot_placeholder(self):
|
||||||
session = CoachingSession(
|
session = CoachingSession(
|
||||||
date="15.08",
|
date="15.08",
|
||||||
skill="ЛУ",
|
skill="ЛУ",
|
||||||
@@ -89,8 +89,8 @@ class ReportTests(unittest.TestCase):
|
|||||||
self.assertIn("Время: 11:00 – 11:20 [20 минут].", text)
|
self.assertIn("Время: 11:00 – 11:20 [20 минут].", text)
|
||||||
self.assertIn("Баллы белки: 6 баллы.", text)
|
self.assertIn("Баллы белки: 6 баллы.", text)
|
||||||
self.assertIn("Баллы бельчонка: 8 баллы.", text)
|
self.assertIn("Баллы бельчонка: 8 баллы.", text)
|
||||||
self.assertIn("[Скриншот Игровой с вашим персонажем", text)
|
self.assertNotIn("Скриншот", text)
|
||||||
self.assertIn("истории", text)
|
self.assertNotIn("истории", text)
|
||||||
|
|
||||||
def test_training_report_is_separate(self):
|
def test_training_report_is_separate(self):
|
||||||
text = render_training(TrainingSession("Белка", 1, "Котёнок", 2))
|
text = render_training(TrainingSession("Белка", 1, "Котёнок", 2))
|
||||||
@@ -111,7 +111,7 @@ class ReportTests(unittest.TestCase):
|
|||||||
self.assertIn("#осмотр", text)
|
self.assertIn("#осмотр", text)
|
||||||
self.assertIn("-2 вьюнок.", text)
|
self.assertIn("-2 вьюнок.", text)
|
||||||
self.assertIn("+1 паук.", text)
|
self.assertIn("+1 паук.", text)
|
||||||
self.assertIn("Скриншот истории и рта.", text)
|
self.assertNotIn("Скриншот", text)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in new issue
Block a user