Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add task tests; move message task to message app (#6964)
* test: Test send_review_reminders_task * refactor: Move send_scheduled_mail_task to message app * chore: Remove unused import * test: Add Message/SendQueue factories * test: Test send_scheduled_mail_task * test: Reset mocks before reuse * test: Cover error conditions * test: Return non-empty change set * test: Test SMTPException handling * test: Test fetch_attendance_from_meetings() * test: Test RuntimeError handling * test: RFC index sync should populate authors
- Loading branch information
1 parent
7438a4e
commit 36c43c8
Showing
7 changed files
with
195 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright The IETF Trust 2024, All Rights Reserved | ||
import factory | ||
|
||
from ietf.person.models import Person | ||
from .models import Message, SendQueue | ||
|
||
|
||
class MessageFactory(factory.django.DjangoModelFactory): | ||
class Meta: | ||
model = Message | ||
|
||
by = factory.LazyFunction(lambda: Person.objects.get(name="(System)")) | ||
subject = factory.Faker("sentence") | ||
to = factory.Faker("email") | ||
frm = factory.Faker("email") | ||
cc = factory.Faker("email") | ||
bcc = factory.Faker("email") | ||
body = factory.Faker("paragraph") | ||
content_type = "text/plain" | ||
|
||
|
||
class SendQueueFactory(factory.django.DjangoModelFactory): | ||
class Meta: | ||
model = SendQueue | ||
|
||
by = factory.LazyFunction(lambda: Person.objects.get(name="(System)")) | ||
message = factory.SubFactory(MessageFactory) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters