On 1/4/20 5:10 AM, ritwik p wrote:
Mark Sapiro wrote:
Because the comment is backwards.
What do you mean by this??
The comment says
# We can't assert anything about member. It will be None when # the workflow we're confirming is an unsubscription request, # and non-None when we're confirming a subscription request. # This class doesn't know which is happening.
That's backwards. I.e, it should say
# We can't assert anything about member. It will be None when # the workflow we're confirming is a subscription request, # and non-None when we're confirming an unsubscription request. # This class doesn't know which is happening.
Create some additional tests for unsubscription when policy is confirm_then_moderate that will fail on the assert member is None. Once you are satisfied that you are testing all the combinations of subscribe/unsubscribe and policy confirm with and without moderate, fix the code so the tests pass.
I haven't really written tests before. Can you point me to any link/docs for the same? Also, where can I write the tests?
See mailman/commands/tests/test_eml_confirm.py for the existing tests. That's where you would add new tests for this.
How can a moderator confirm the unsubscription request??
Usually, through the Postorius web UI, but also by email, and you need to be sure that's tested too.
Can I do it with
mailman inject?? If yes, then how??
You can use
mailman inject in lieu of sending email, but you can't
test the REST interface that Postorius uses that way.