[Patchew-devel] [PATCH] test: more testcases around authorization

Fam Zheng famz at redhat.com
Fri May 18 02:42:00 UTC 2018


On Fri, 05/18 08:04, Shubham Jain wrote:
> Thanks, now things make more sense than earlier.
> On Fri, May 18, 2018 at 7:34 AM Fam Zheng <famz at redhat.com> wrote:
> 
> > On Thu, 05/17 22:55, Shubham Jain wrote:
> > > > > +        if request.user.is_superuser or 'importers' in
> > user_group_names:
> > > > > +            projects = [p for p in Project.objects.all() if
> > > > p.recognizes(m)]
> > > > > +        else:
> > > > > +            projects =  [p for p in Project.objects.all() if
> > > > p.maintained_by(self.request.user)]
> > > >
> > > > I think the else branch should still union the p.recognizes()
> > filtering.
> >
> > Wrong term. I meant "intersect".
> >
> > > >
> > > As you have mentioned in the test case below
> > > "test_maintainer_of_project_x_import_a_patch_to_project_y()", does this
> >
> > And this is actually
> > "test_maintainer_of_project_x_cannot_import_a_patch_to_project_y().
> 
> This is covered in test_maintainer_create_message() itself where the two
> projects recognised the mbox but it is imported to the one where the user
> was the maintainer.

That's right, I missed it. Thanks.

Fam




More information about the Patchew-devel mailing list