Merge ~ilasc/launchpad:permissions-close-account-job into launchpad:master

Proposed by Ioana Lasc
Status: Merged
Approved by: Ioana Lasc
Approved revision: b75287d058a2b4feee20be4e8588619588756617
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ilasc/launchpad:permissions-close-account-job
Merge into: launchpad:master
Diff against target: 47 lines (+5/-2)
3 files modified
lib/lp/registry/configure.zcml (+4/-0)
lib/lp/registry/tests/test_person_close_account_job.py (+0/-2)
lib/lp/services/config/schema-lazr.conf (+1/-0)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+402019@code.launchpad.net

Commit message

Adjust permissions for Close Account job

Description of the change

Deleting the removeSecurityProxy for jobs will not cause the unit test to fail anymore. Previously without the removeSecurityProxy in place, unit test were failing exactly like the dogfood runs (https://pastebin.canonical.com/p/VS9KN6qGgP/).

Local CLI run of the job now: https://pastebin.canonical.com/p/tYq4vCwkQJ/

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Good job!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/configure.zcml b/lib/lp/registry/configure.zcml
2index ac3d82b..2e05088 100644
3--- a/lib/lp/registry/configure.zcml
4+++ b/lib/lp/registry/configure.zcml
5@@ -150,6 +150,10 @@
6 <allow interface=".interfaces.persontransferjob.IPersonDeactivateJob"/>
7 </class>
8
9+ <class class=".model.persontransferjob.PersonCloseAccountJob">
10+ <allow interface=".interfaces.persontransferjob.IPersonCloseAccountJob"/>
11+ </class>
12+
13 <class class=".model.persontransferjob.TeamInvitationNotificationJob">
14 <allow interface=".interfaces.persontransferjob.ITeamInvitationNotificationJob"/>
15 </class>
16diff --git a/lib/lp/registry/tests/test_person_close_account_job.py b/lib/lp/registry/tests/test_person_close_account_job.py
17index f7a3da6..eb71135 100644
18--- a/lib/lp/registry/tests/test_person_close_account_job.py
19+++ b/lib/lp/registry/tests/test_person_close_account_job.py
20@@ -53,7 +53,6 @@ class TestPersonCloseAccountJob(TestCaseWithFactory):
21
22 getUtility(IPersonCloseAccountJobSource).create(user_to_delete)
23 jobs = list(job_source.iterReady())
24- jobs[0] = removeSecurityProxy(jobs[0])
25 with dbuser(config.IPersonCloseAccountJobSource.dbuser):
26 JobRunner(jobs).runAll()
27
28@@ -69,7 +68,6 @@ class TestPersonCloseAccountJob(TestCaseWithFactory):
29 IPersonCloseAccountJobSource).create(user_to_delete)
30 job_source = getUtility(IPersonCloseAccountJobSource)
31 jobs = list(job_source.iterReady())
32- jobs[0] = removeSecurityProxy(jobs[0])
33 with dbuser(config.IPersonCloseAccountJobSource.dbuser):
34 JobRunner(jobs).runAll()
35 self.assertEqual(JobStatus.COMPLETED, jobs[0].status)
36diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
37index 50ad59d..752093f 100644
38--- a/lib/lp/services/config/schema-lazr.conf
39+++ b/lib/lp/services/config/schema-lazr.conf
40@@ -1798,6 +1798,7 @@ job_sources:
41 IOCIRecipeRequestBuildsJobSource,
42 IOCIRegistryUploadJobSource,
43 IPackageUploadNotificationJobSource,
44+ IPersonCloseAccountJobSource,
45 IPersonDeactivateJobSource,
46 IPersonMergeJobSource,
47 IPlainPackageCopyJobSource,

Subscribers

People subscribed via source and target branches

to status/vote changes: