Fixes https://pagure.io/pagure/issue/1293
4 new commits added
Did you mean "Objet" or "Object"? "Objet" is used consistently in the code, but it looks a bit odd.
Object indeed :)
1 new commit added
The docblock indicates that the username should be passed in the POST body, but it looks like the authenticated username is used instead. I actually like this behavior more because users probably don't want other users to be able to change their subscriptions. Maybe remove username from the docblock?
Are all three of the above print statements stray?
true there, for both endpoints even I think
for now, they are debugging statements for jenkins (see the last commit messages :))
This seems like a stray statement as well.
Is there a reason to include the username since the view uses the username from the session?
yes it's needed for retrieving the right project
yup
It would be cleaner to break each test condition into its own test, so each test is shorter/easier to understand and separately concerned.
Stray print.
It also means re-creating the environment for the tests each time which is going to end up time-consuming (tests are already taking ~15minutes on jenkins these days!)
And the name of the function are going to end up over the 80 chars line, no? :D
It would also be cleaner to break this up into several tests for the various conditions.
You can use the class level set up method instead of setUp() to do the setup once to save time, if you want. That would save some time but still allow your tests to be more atomic/readable.
I personally like 100 columns because I don't want 1980's monitors to restrict my ability to be expressive with my variables/methods, but that's just an opinion ☺ It's the one part of PEP-8 that I explicitly choose to violate (I like 100 columns instead).
The only thing I think needs to be changed before merging is to remove the documentation that says that username is used from the POST body since it is used from the session (which I think is the ideal behavior anyway). Everything else I said is just a suggestion that you can feel free to ignore if you like.
LGTM.
30 new commits added
Ok, I think I got all of your remarks and cleaned up the debugging commits.
I'll wait for jenkins to say something and if it's clear I'll merge.
Thanks for your review!
Jenkins is happy, let's merge!
Fixes https://pagure.io/pagure/issue/1293