diff options
| author | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
| commit | a9464c14fc6dfc23613a1ec89446393fe6476f88 (patch) | |
| tree | 74a926cfe64066ebffcf9adb89e7672289173d84 /src/mailman/rest/tests/test_users.py | |
| parent | a1666479d87e26e5c79dd1cf507b8ef0472c59aa (diff) | |
| download | mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.gz mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.zst mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.zip | |
Diffstat (limited to 'src/mailman/rest/tests/test_users.py')
| -rw-r--r-- | src/mailman/rest/tests/test_users.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mailman/rest/tests/test_users.py b/src/mailman/rest/tests/test_users.py index 301027885..4595c69d8 100644 --- a/src/mailman/rest/tests/test_users.py +++ b/src/mailman/rest/tests/test_users.py @@ -45,10 +45,6 @@ class TestUsers(unittest.TestCase): def test_delete_bogus_user(self): # Try to delete a user that does not exist. - try: - # For Python 2.6. + with self.assertRaises(HTTPError) as cm: call_api('http://localhost:9001/3.0/users/99', method='DELETE') - except HTTPError as exc: - self.assertEqual(exc.code, 404) - else: - raise AssertionError('Expected HTTPError') + self.assertEqual(cm.exception.code, 404) |
