
Mark Sapiro wrote:
Because the comment is backwards.
What do you mean by this??
because member exists when when we are unsubscribing a member and member doesn't yet exist when we are subscribing a new member. The comment We can't assert anything about member. actually applies to all the conditions, not just if new_token is None: The point is that the comment is wrong and also that elif token_owner is TokenOwner.moderator: # This must have been a confirm-then-moderator subscription.
is wrong because it could also be a confirm-then-moderate unsubscription
That's what I meant by the "root" problem.
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?
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??
Thanks Mark :)