def test_outgoing_email(self, mock):
        """Test that the digest is properly sent"""
        user = self.create_user()

        group = self.create_group()
        user.add_to_group(group.pk, period='daily')

        thread1 = self.create_thread(group=group)
        thread2 = self.create_thread(group=group)

        tasks.send_daily_digest_notification(user.pk)
        mock.assert_called_once()

        args = mock.call_args[1]

        # To
        email = args['email']
        self.assertIn(user.email, email)
        self.assertIn(user.get_full_name(), email)

        # From
        from_email = args['from_email']
        self.assertIn(settings.DEFAULT_FROM_ADDRESS, from_email)
        self.assertEqual(settings.DEFAULT_FROM_EMAIL, from_email)

        # Subject
        subject = args['subject']
        self.assertIn('2 New Messages', subject)
        days_of_week = [
            'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
            'Saturday'
        ]
        self.assertTrue(any([subject in dayname for dayname in days_of_week]))

        # Body (HTML and Plaintext)
        html = args['html']
        plaintext = args['text']
        self.assertIn(thread1.first_message.text, html)
        self.assertIn(thread2.first_message.text, html)
        self.assertIn('Reply', html)
        self.assertIn(thread1.first_message.clean_text, plaintext)
        self.assertIn(thread2.first_message.clean_text, plaintext)
dataset/ETHPy150Open ofa/connect/open_connect/notifications/tests/test_tasks.py/TestSendDailyDigestNotification.test_outgoing_email/swapped operands of `in`