Test for UnsignReport

This commit is contained in:
al8763be 2024-04-09 22:17:50 +02:00
parent 67723bfccc
commit 57e969a562
2 changed files with 7 additions and 3 deletions

View file

@ -36,6 +36,6 @@ func UnsignReport(c *fiber.Ctx) error {
return c.Status(500).SendString(err.Error()) return c.Status(500).SendString(err.Error())
} }
log.Info("Project manager ID: ", projectManagerID, " signed report ID: ", reportId) log.Info("Project manager ID: ", projectManagerID, " unsigned report ID: ", reportId)
return c.Status(200).SendString("Weekly report unsigned successfully") return c.Status(200).SendString("Weekly report unsigned successfully")
} }

View file

@ -264,7 +264,9 @@ def test_unsign_report():
dprint("Sign report successful") dprint("Sign report successful")
# Retrieve the report ID again for confirmation # Retrieve the report ID again for confirmation
report_id = getReport(member_token, member_user, project_name)["reportId"] report = getReport(member_token, member_user, project_name)
dprint(report)
report_id = report["reportId"]
assert report_id != None, "Get report failed" assert report_id != None, "Get report failed"
# Unsign the report as the project manager # Unsign the report as the project manager
@ -273,8 +275,10 @@ def test_unsign_report():
dprint("Unsign report successful") dprint("Unsign report successful")
# Retrieve the report ID again for confirmation # Retrieve the report ID again for confirmation
report_id = getReport(member_token, member_user, project_name)["reportId"] report = getReport(member_token, member_user, project_name)
assert report_id != None, "Get report failed" assert report_id != None, "Get report failed"
dprint(report)
assert report["signed_by"] == None, "Report was not unsigned"
gprint("test_unsign_report successful") gprint("test_unsign_report successful")