diff --git a/log_outgoing_requests/models.py b/log_outgoing_requests/models.py index 84cbd0a..4be6a01 100644 --- a/log_outgoing_requests/models.py +++ b/log_outgoing_requests/models.py @@ -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. diff --git a/tests/test_admin.py b/tests/test_admin.py index 60399a0..5916bab 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -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 @@ -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"""