Skip to content

Commit

Permalink
[#44] Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Nov 7, 2024
1 parent 6b27f34 commit 5f69a48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion log_outgoing_requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ def response_body_decoded(self) -> str:
@cached_property
def response_content_length(self) -> str:
"""
Get Response content length by reading `len(body)`.
Get Response content length by reading `len(body)`.
"""
return str(len(self.response_body_decoded))

response_content_length.short_description = _("Response content length") # type: ignore


def get_default_max_content_length():
"""
Get default value for max content length from settings.
Expand Down
5 changes: 4 additions & 1 deletion tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def test_response_content_length_empty(admin_client):
res_body=b"",
timestamp=timezone.now(),
)
url = reverse("admin:log_outgoing_requests_outgoingrequestslog_change", args=(log.pk,))
url = reverse(
"admin:log_outgoing_requests_outgoingrequestslog_change", args=(log.pk,)
)

response = admin_client.get(url)
assert response.status_code == 200
Expand All @@ -158,6 +160,7 @@ def test_response_content_length_empty(admin_client):
assert response_body == "-"
assert content_length == "0"


@pytest.mark.django_db
def test_response_content_length_displayed(admin_client):
"""Assert the length of the content of the response is displayed"""
Expand Down

0 comments on commit 5f69a48

Please sign in to comment.