from app.na_celery.email_tasks import send_emails


class WhenProcessingSendEmailsTask:

    def it_calls_send_email_to_task(self, mocker, db, db_session, sample_admin_user, sample_email):
        mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email')
        send_emails(sample_email.id)

        assert mock_send_email.call_args[0][0] == 'admin@example.com'
        assert mock_send_email.call_args[0][1] == 'workshop: test title'

    def it_sends_an_email_to_members_up_to_email_limit(self):
        pass

    def it_does_not_send_an_email_if_not_between_start_and_expiry(self):
        pass

    def it_sends_email_with_correct_template(self):
        pass

from app.na_celery.email_tasks import send_emails


class WhenProcessingSendEmailsTask:

    def it_calls_send_email_to_task(self, mocker, db, db_session, sample_email, sample_member):
        mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email', return_value=200)
        send_emails(sample_email.id)

        assert mock_send_email.call_args[0][0] == sample_member.email
        assert mock_send_email.call_args[0][1] == 'workshop: test title'

    def it_sends_an_email_to_members_up_to_email_limit(self):
        pass

    def it_does_not_send_an_email_if_not_between_start_and_expiry(self):
        pass

    def it_sends_email_with_correct_template(self):
        pass

Update email task test for members
Update email task test for members
