Skip to content

Commit

Permalink
this is just WIP, waiting for a PR on test.py isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Dec 19, 2024
1 parent d5698eb commit a32a2f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@


SECRET_KEY = "jumpinjackflash"
DEBUG = False
DEBUG = True
ENVIRONMENT = Environment.DEV
ALLOWED_HOSTS = []
COMPRESS_ENABLED = False
# COMPRESS_ENABLED = False

# Database
# ------------------------------------------------------------------------------
Expand All @@ -34,13 +34,13 @@

# ProConnect
# ------------------------------------------------------------------------------
OPENID_CONNECT_BASE_URL = os.getenv("OPENID_CONNECT_BASE_URL", "http://127.0.0.1:8080")
OPENID_CONNECT_CLIENT_ID = os.getenv("OPENID_CONNECT_CLIENT_ID", "local_openid_connect")
OPENID_CONNECT_CLIENT_SECRET = os.getenv("OPENID_CONNECT_CLIENT_SECRET", "password")
# OPENID_CONNECT_BASE_URL = os.getenv("OPENID_CONNECT_BASE_URL", "http://127.0.0.1:8080")
# OPENID_CONNECT_CLIENT_ID = os.getenv("OPENID_CONNECT_CLIENT_ID", "local_openid_connect")
# OPENID_CONNECT_CLIENT_SECRET = os.getenv("OPENID_CONNECT_CLIENT_SECRET", "password")

# SENDINBLUE / BREVO
# ---------------------------------------
SIB_URL = os.getenv("SIB_URL", "https://test.com")
SIB_SMTP_URL = urljoin(SIB_URL, "smtp/email")
SIB_CONTACTS_URL = urljoin(SIB_URL, "contacts/import")
SIB_API_KEY = os.getenv("SIB_API_KEY", "key_to_be_set")
# SIB_API_KEY = os.getenv("SIB_API_KEY", "key_to_be_set")
6 changes: 3 additions & 3 deletions lacommunaute/notification/tasks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# from config.settings.base import NEW_MESSAGES_EMAIL_MAX_PREVIEW, SIB_NEW_MESSAGES_TEMPLATE
from django.conf import settings
from django.template.defaultfilters import pluralize
from django.urls import reverse
from django.utils import timezone

from config.settings.base import NEW_MESSAGES_EMAIL_MAX_PREVIEW, SIB_NEW_MESSAGES_TEMPLATE
from lacommunaute.forum_conversation.models import Topic
from lacommunaute.forum_member.shortcuts import get_forum_member_display_name
from lacommunaute.notification.emails import bulk_send_user_to_list, send_email
Expand Down Expand Up @@ -31,13 +31,13 @@ def get_grouped_notifications():

params = {
"email_thumbnail": (f"Vous avez {message_count_text} à découvrir sur la communauté de l'inclusion"),
"messages": get_serialized_messages(recipient_notifications[:NEW_MESSAGES_EMAIL_MAX_PREVIEW]),
"messages": get_serialized_messages(recipient_notifications[: settings.NEW_MESSAGES_EMAIL_MAX_PREVIEW]),
}
send_email(
to=[{"email": recipient}],
params=params,
kind=EmailSentTrackKind.BULK_NOTIFS,
template_id=SIB_NEW_MESSAGES_TEMPLATE,
template_id=settings.SIB_NEW_MESSAGES_TEMPLATE,
)

notifications.update(sent_at=timezone.now())
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ format_js = false

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "config.settings.test"
FAIL_INVALID_TEMPLATE_VARS = true
# FAIL_INVALID_TEMPLATE_VARS = true
python_files = ["tests*.py", "test_*.py"]
addopts = [
"--reuse-db",
Expand Down

0 comments on commit a32a2f5

Please sign in to comment.