def test_send_mass_mail(self): from froide.account.management.commands.send_mass_mail import Command user_count = User.objects.all().count() mail.outbox = [] command = Command() subject, content = 'Test', 'Testing-Content' list(command.send_mail(subject, content)) self.assertEqual(len(mail.outbox), user_count)