Notifications: Continuer à envoyer les notifications aux anciens collaborateurs#5354
Notifications: Continuer à envoyer les notifications aux anciens collaborateurs#5354
Conversation
| assert len(mailoutbox) == 2 | ||
| assert set(mailoutbox[0].to + mailoutbox[1].to) == {admin_1.email, admin_2.email} | ||
| assert len(mailoutbox) == 3 | ||
| assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, self.user.email} |
There was a problem hiding this comment.
| assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, self.user.email} | |
| assert set(*(mail.to for mail in mailoutbox)) == {admin_1.email, admin_2.email, self.user.email} |
There was a problem hiding this comment.
Je vois pas comment ça pourrait marcher vu que mail.to est une liste.
A priori il n'y a qu'un seul élément dedans, mais c'est mieux de le vérifier
Sinon on peut faire assert set(mail.to[0] for mail in mailoutbox) == {admin_1.email, admin_2.email, user.email}
There was a problem hiding this comment.
arf effectivement 🤦
Tu as aussi set(itertools.chain.from_iterable(mail.to for mail in mailoutbox)) en alternative 😛
There was a problem hiding this comment.
Ah, ça c'est cool, je connaissais pas !
| assert len(mailoutbox) == 2 | ||
| assert set(mailoutbox[0].to + mailoutbox[1].to) == {admin_1.email, admin_2.email} | ||
| assert len(mailoutbox) == 3 | ||
| assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, user.email} |
There was a problem hiding this comment.
| assert set(sum((mail.to for mail in mailoutbox), [])) == {admin_1.email, admin_2.email, user.email} | |
| assert set(*(mail.to for mail in mailoutbox)) == {admin_1.email, admin_2.email, user.email} |
|
Je merge pour rétablir le bon fonctionnement, mais la discussion sur ta syntaxe alternative n'est pas fermée : je passe peut être à côté d'un truc cool de python alors ça m'intéresse de savoir ce qu'il en est :) |
For now.
🤔 Pourquoi ?
🍰 Comment ?
🚨 À vérifier
🏝️ Comment tester
💻 Captures d'écran