From 063b325986d05f00f3d7c81699af8a7d5e481452 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 28 Jun 2016 03:01:29 -0400 Subject: [PATCH] Fix file descriptor leak in document signature download test. --- mayan/apps/document_signatures/tests/test_views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mayan/apps/document_signatures/tests/test_views.py b/mayan/apps/document_signatures/tests/test_views.py index adaeebe697..2b0ff6b0f0 100644 --- a/mayan/apps/document_signatures/tests/test_views.py +++ b/mayan/apps/document_signatures/tests/test_views.py @@ -218,9 +218,10 @@ class SignaturesViewTestCase(GenericDocumentViewTestCase): args=(signature.pk,), ) - assert_download_response( - self, response=response, content=signature.signature_file.read(), - ) + with signature.signature_file as file_object: + assert_download_response( + self, response=response, content=file_object.read(), + ) def test_signature_delete_view_no_permission(self): with open(TEST_KEY_FILE) as file_object: