mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #26022 -- Used context manager version of assertRaises in tests.
This commit is contained in:
@@ -87,8 +87,10 @@ class TestPostgisVersionCheck(unittest.TestCase):
|
||||
|
||||
for version in versions:
|
||||
ops = FakePostGISOperations(version)
|
||||
self.assertRaises(Exception, lambda: ops.spatial_version)
|
||||
with self.assertRaises(Exception):
|
||||
ops.spatial_version
|
||||
|
||||
def test_no_version_number(self):
|
||||
ops = FakePostGISOperations()
|
||||
self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
|
||||
with self.assertRaises(ImproperlyConfigured):
|
||||
ops.spatial_version
|
||||
|
||||
Reference in New Issue
Block a user