Skip to content

Commit

Permalink
Merge pull request #51 from ARYAN-NIKNEZHAD/develop
Browse files Browse the repository at this point in the history
Develop to Main
  • Loading branch information
ARYAN-NIKNEZHAD authored Aug 29, 2024
2 parents b62cabc + 67c5566 commit d6a3270
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion django_logging/middleware/request_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __call__(self, request: HttpRequest) -> HttpResponse:
request.browser_type = user_agent

logger.info(
"Request Info: (request_path: %s, user: %s," "\nIP: %s, user_agent: %s)",
"Request Info: (request_path: %s, user: %s,\n IP: %s, user_agent: %s)",
request.path,
user,
ip_address,
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/email_notifier_fixture.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Generator
from typing import Generator, Tuple
from unittest.mock import MagicMock, patch

import pytest
Expand Down Expand Up @@ -46,7 +46,7 @@ def email_mock_settings() -> Generator[MagicMock, None, None]:


@pytest.fixture
def notifier_mock_logger() -> Generator[tuple[MagicMock, MagicMock], None, None]:
def notifier_mock_logger() -> Generator[Tuple[MagicMock, MagicMock], None, None]:
"""
Fixture to mock the logger used for logging messages.
Expand Down
5 changes: 3 additions & 2 deletions tests/utils/test_email_notifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import threading
from smtplib import SMTPException
from typing import Tuple
from unittest.mock import ANY, MagicMock

import pytest
Expand All @@ -21,7 +22,7 @@ def test_send_email_async_success(
self,
mock_smtp: MagicMock,
email_mock_settings: MagicMock,
notifier_mock_logger: tuple[MagicMock, MagicMock],
notifier_mock_logger: Tuple[MagicMock, MagicMock],
) -> None:
"""
Test that the send_email_async function successfully sends an email.
Expand Down Expand Up @@ -91,7 +92,7 @@ def test_send_email_async_failure(
self,
mock_smtp: MagicMock,
email_mock_settings: MagicMock,
notifier_mock_logger: tuple[MagicMock, MagicMock],
notifier_mock_logger: Tuple[MagicMock, MagicMock],
) -> None:
"""
Test that the send_email_async function handles SMTP failures.
Expand Down

0 comments on commit d6a3270

Please sign in to comment.