mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2).
This commit is contained in:
parent
7d20094996
commit
5320fa77c3
3 changed files with 7 additions and 10 deletions
|
@ -4,7 +4,6 @@ django.contrib.staticfiles.testing.StaticLiveServerTestCase instead of
|
|||
django.test.LiveServerTestCase.
|
||||
"""
|
||||
|
||||
import contextlib
|
||||
import os
|
||||
from urllib.request import urlopen
|
||||
|
||||
|
@ -86,5 +85,5 @@ class StaticLiveServerView(LiveServerBase):
|
|||
StaticLiveServerTestCase use of staticfiles' serve() allows it
|
||||
to discover app's static assets without having to collectstatic first.
|
||||
"""
|
||||
with contextlib.closing(self.urlopen('/static/test/file.txt')) as f:
|
||||
with self.urlopen('/static/test/file.txt') as f:
|
||||
self.assertEqual(f.read().rstrip(b'\r\n'), b'In static directory.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue