Verified Commit 2554b316 authored by urbec's avatar urbec 🐣 Committed by Mattia Rizzolo
Browse files

Fixing calculation of AM slots, re-enable related test. Closes #956898



(related test was adding a signed statement for AM report)

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 50436ab0
Pipeline #264844 passed with stage
in 5 minutes and 44 seconds
......@@ -826,12 +826,17 @@ class AM(models.Model):
# loop through open processes and collect the AM status of each
for p in pmodels.AMAssignment.objects.filter(
# The process is still open
# The process is not frozen or approved
process__frozen_by__isnull=True,
process__approved_by__isnull=True,
# The process is still open
process__closed_time__isnull=True,
# The AM hasn't been unassigned
unassigned_by__isnull=True,
# The AM report requirement is not approved yet
# (if it is, the AM is no longer active on that assignement)
process__requirements__type='am_ok',
process__requirements__approved_time__isnull=True,
).select_related("am"):
am = ams[p.am]
if p.paused:
......
......@@ -6,7 +6,7 @@ from backend import const
import process.models as pmodels
import backend.models as bmodels
from unittest.mock import patch
from process.unittest import (ProcessFixtureMixin, test_fingerprint1, test_fpr1_signed_valid_text)
from process.unittest import ProcessFixtureMixin, test_fingerprint1, test_fpr1_signed_valid_text
from process import ops as pops
......@@ -219,15 +219,14 @@ class TestAMSlots(ProcessFixtureMixin, TestCase):
"stats_active_expected_value": 1,
"stats_held_expected_value": 0,
"stats_free_expected_value": 0})
# FIXME XFAIL: https://bugs.debian.org/956898
# add signed statement for AM report
# req = self.processes.dc.requirements.get(type="am_ok")
# self.statements.create("am_ok", requirement=req, fpr=self.fingerprints.dc,
# statement=test_fpr1_signed_valid_text, uploaded_by=self.persons.activeam,
# uploaded_time=now())
# o = pops.ProcessStatementAdd(audit_author=self.persons.activeam, requirement=req, statement="am_ok")
# o.execute()
# self.check_amlist({"am_person_id": self.ams.activeam.person_id,
# "stats_active_expected_value": 0,
# "stats_held_expected_value": 0,
# "stats_free_expected_value": 1})
req = self.processes.dc.requirements.get(type="am_ok")
self.statements.create("am_ok", requirement=req, fpr=self.fingerprints.dc,
statement=test_fpr1_signed_valid_text, uploaded_by=self.persons.activeam,
uploaded_time=now())
o = pops.ProcessStatementAdd(audit_author=self.persons.activeam, requirement=req, statement="am_ok")
o.execute()
self.check_amlist({"am_person_id": self.ams.activeam.person_id,
"stats_active_expected_value": 0,
"stats_held_expected_value": 0,
"stats_free_expected_value": 1})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment