Verified Commit cc8ed316 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

some flake8 fixes



Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 4aa83377
...@@ -48,8 +48,10 @@ the nm.debian.org housekeeping robot ...@@ -48,8 +48,10 @@ the nm.debian.org housekeeping robot
cc=process.archive_email, cc=process.archive_email,
reply_to=["nm@debian.org", process.archive_email, process.person], reply_to=["nm@debian.org", process.archive_email, process.person],
subject="New Member process, {}".format( subject="New Member process, {}".format(
const.ALL_STATUS_DESCS[process.applying_for]), const.ALL_STATUS_DESCS[process.applying_for]
body=body) ),
body=body,
)
msg.send() msg.send()
log.debug("sent mail from %s to %s cc %s bcc %s reply-to: %s subject %s", log.debug("sent mail from %s to %s cc %s bcc %s reply-to: %s subject %s",
msg.from_email, msg.from_email,
......
...@@ -22,6 +22,7 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase): ...@@ -22,6 +22,7 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase):
def test_basic_op(self): def test_basic_op(self):
o = pops.ProcessAssignAM(audit_author=self.persons.fd, process=self.processes.app, am=self.ams.activeam) o = pops.ProcessAssignAM(audit_author=self.persons.fd, process=self.processes.app, am=self.ams.activeam)
@self.assertOperationSerializes(o) @self.assertOperationSerializes(o)
def _(o): def _(o):
self.assertEqual(o.audit_author, self.persons.fd) self.assertEqual(o.audit_author, self.persons.fd)
...@@ -58,7 +59,10 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase): ...@@ -58,7 +59,10 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase):
self.assertEqual(len(ops), 0) self.assertEqual(len(ops), 0)
with self.collect_operations() as ops: with self.collect_operations() as ops:
response = client.post(reverse("process_assign_am", args=[self.processes.app.pk]), data={"am": self.persons.am.lookup_key}) response = client.post(reverse(
"process_assign_am", args=[self.processes.app.pk]
), data={"am": self.persons.am.lookup_key}
)
self.assertRedirectMatches(response, reverse("process_req_am_ok", args=[self.processes.app.pk])) self.assertRedirectMatches(response, reverse("process_req_am_ok", args=[self.processes.app.pk]))
self.assertEqual(len(ops), 1) self.assertEqual(len(ops), 1)
...@@ -77,7 +81,10 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase): ...@@ -77,7 +81,10 @@ class TestProcessAMAssign(ProcessFixtureMixin, TestCase):
self.assertEqual(len(ops), 0) self.assertEqual(len(ops), 0)
with self.collect_operations() as ops: with self.collect_operations() as ops:
response = client.post(reverse("process_assign_am", args=[self.processes.app.pk]), data={"am": self.persons.am.lookup_key}) response = client.post(reverse(
"process_assign_am", args=[self.processes.app.pk]
), data={"am": self.persons.am.lookup_key}
)
self.assertPermissionDenied(response) self.assertPermissionDenied(response)
self.assertEqual(len(ops), 0) self.assertEqual(len(ops), 0)
...@@ -90,12 +97,19 @@ class TestProcessAMUnassign(ProcessFixtureMixin, TestCase): ...@@ -90,12 +97,19 @@ class TestProcessAMUnassign(ProcessFixtureMixin, TestCase):
cls.processes.create("app", person=cls.persons.app, applying_for=const.STATUS_DD_U, fd_comment="test") cls.processes.create("app", person=cls.persons.app, applying_for=const.STATUS_DD_U, fd_comment="test")
cls.create_person("am", status=const.STATUS_DD_NU) cls.create_person("am", status=const.STATUS_DD_NU)
cls.ams.create("am", person=cls.persons.am) cls.ams.create("am", person=cls.persons.am)
cls.amassignments.create("am", process=cls.processes.app, am=cls.ams.am, assigned_by=cls.persons.fd, assigned_time=now()) cls.amassignments.create(
"am",
process=cls.processes.app,
am=cls.ams.am,
assigned_by=cls.persons.fd,
assigned_time=now()
)
cls.visitor = cls.persons.dc cls.visitor = cls.persons.dc
def test_basic_op(self): def test_basic_op(self):
o = pops.ProcessUnassignAM(audit_author=self.persons.fd, assignment=self.amassignments.am) o = pops.ProcessUnassignAM(audit_author=self.persons.fd, assignment=self.amassignments.am)
@self.assertOperationSerializes(o) @self.assertOperationSerializes(o)
def _(o): def _(o):
self.assertEqual(o.audit_author, self.persons.fd) self.assertEqual(o.audit_author, self.persons.fd)
......
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