1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #27804 -- Used subTest() in several tests.

This commit is contained in:
Bruno Alla
2017-03-07 21:00:43 +00:00
committed by Tim Graham
parent 91b2bc3e70
commit 6092ea8fa6
19 changed files with 324 additions and 262 deletions

View File

@@ -76,17 +76,19 @@ class TestPostGISVersionCheck(unittest.TestCase):
]
for version in versions:
ops = FakePostGISOperations(version[0])
actual = ops.spatial_version
self.assertEqual(version[1:], actual)
with self.subTest(version=version):
ops = FakePostGISOperations(version[0])
actual = ops.spatial_version
self.assertEqual(version[1:], actual)
def test_invalid_version_numbers(self):
versions = ['nope', '123']
for version in versions:
ops = FakePostGISOperations(version)
with self.assertRaises(Exception):
ops.spatial_version
with self.subTest(version=version):
ops = FakePostGISOperations(version)
with self.assertRaises(Exception):
ops.spatial_version
def test_no_version_number(self):
ops = FakePostGISOperations()