fix tests after the previous commit (and also add a specific test, so to check…

fix tests after the previous commit (and also add a specific test, so to check the None/not-None possible values)
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 4c5d4a63
Pipeline #26838 passed with stage
in 4 minutes and 44 seconds
......@@ -145,13 +145,31 @@ class TestCheckLDAPConsistency(ProcessFixtureMixin, TestCase):
task = CheckLDAPConsistency(self.hk)
task.run_main(None)
l.check(
("dsa.housekeeping", "WARNING", "None: dd_u has accountStatus 'inactive 2018-03-20' but in our db the state is Debian Developer, uploading"),
("dsa.housekeeping", "WARNING", "None: dd_u has accountStatus 'inactive 2018-03-20' (comment: None) but in our db the state is Debian Developer, uploading"),
)
p = self.persons.dd_u
p.refresh_from_db()
self.assertEqual(p.audit_log.count(), 0)
def test_unexpected_inactive_with_comment(self):
with mock.patch("dsa.models.list_people") as m:
m.return_value = [
MockEntry("dd_u", supplementaryGid=["Debian"], cn="Dd_u", mn="", sn="", emailForward="dd_u@example.org", keyFingerPrint="66B4DFB68CB24EBBD8650BC4F4B4B0CC797EBFAB", accountStatus="inactive 2018-03-20", accountComment="RT#1234"),
]
with LogCapture() as l:
task = CheckLDAPConsistency(self.hk)
task.run_main(None)
l.check(
("dsa.housekeeping", "WARNING", "None: dd_u has accountStatus 'inactive 2018-03-20' (comment: RT#1234) but in our db the state is Debian Developer, uploading"),
)
p = self.persons.dd_u
p.refresh_from_db()
self.assertEqual(p.audit_log.count(), 0)
def test_close_emeritus_process(self):
with mock.patch("dsa.models.list_people") as m:
process = Process.objects.create(person=self.persons.dd_u, applying_for=const.STATUS_EMERITUS_DD)
......
Markdown is supported
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