Skip to content

Commit 794c9d4

Browse files
committed
fix test
1 parent 17e7424 commit 794c9d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flask_pymongo/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,16 @@ def get_upload(filename):
183183
response.headers["Content-Disposition"] = f"attachment; filename={filename}"
184184
response.content_length = fileobj.length
185185
response.last_modified = fileobj.upload_date
186-
response.cache_control.max_age = cache_for
187-
response.cache_control.public = True
188-
response.make_conditional(request)
189186

190187
# Get or compute the sha1 sum for the etag.
191188
metadata = fileobj.metadata
192189
sha1_sum = metadata and metadata.get("sha1_sum")
193190
sha1_sum = sha1_sum or self._compute_sha(fileobj)
194191
response.set_etag(sha1_sum)
195192

193+
response.cache_control.max_age = cache_for
194+
response.cache_control.public = True
195+
response.make_conditional(request)
196196
return response
197197

198198
def save_file(

tests/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ def setUp(self):
3333
def tearDown(self):
3434
assert self.mongo.cx is not None
3535
self.mongo.cx.drop_database(self.dbname)
36-
36+
self.mongo.cx.close()
3737
super().tearDown()

0 commit comments

Comments
 (0)