Removed useless warning silencing.
If memory serves, the corresponding warning disappeared in Django 1.7.
This commit is contained in:
parent
06160cb945
commit
ad83d37bf8
|
@ -6,7 +6,6 @@ import json
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
from django.core.exceptions import SuspiciousOperation
|
from django.core.exceptions import SuspiciousOperation
|
||||||
from django.core.serializers.json import DjangoJSONEncoder
|
from django.core.serializers.json import DjangoJSONEncoder
|
||||||
|
@ -18,7 +17,6 @@ from django.http import (QueryDict, HttpResponse, HttpResponseRedirect,
|
||||||
SimpleCookie, BadHeaderError, JsonResponse,
|
SimpleCookie, BadHeaderError, JsonResponse,
|
||||||
parse_cookie)
|
parse_cookie)
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.utils.deprecation import RemovedInDjango18Warning
|
|
||||||
from django.utils.encoding import smart_str, force_text
|
from django.utils.encoding import smart_str, force_text
|
||||||
from django.utils.functional import lazy
|
from django.utils.functional import lazy
|
||||||
from django.utils._os import upath
|
from django.utils._os import upath
|
||||||
|
@ -561,9 +559,7 @@ class FileCloseTests(TestCase):
|
||||||
file1 = open(filename)
|
file1 = open(filename)
|
||||||
r = HttpResponse(file1)
|
r = HttpResponse(file1)
|
||||||
self.assertFalse(file1.closed)
|
self.assertFalse(file1.closed)
|
||||||
with warnings.catch_warnings():
|
list(r)
|
||||||
warnings.simplefilter("ignore", RemovedInDjango18Warning)
|
|
||||||
list(r)
|
|
||||||
self.assertFalse(file1.closed)
|
self.assertFalse(file1.closed)
|
||||||
r.close()
|
r.close()
|
||||||
self.assertTrue(file1.closed)
|
self.assertTrue(file1.closed)
|
||||||
|
|
Loading…
Reference in New Issue