~barry/mailman/templatecache

« back to all changes in this revision

Viewing changes to src/mailman/rest/tests/test_users.py

  • Committer: Barry Warsaw
  • Date: 2012-10-31 16:37:22 UTC
  • mfrom: (7178.1.1 work2)
  • Revision ID: barry@list.org-20121031163722-3lszhsiv9ai0akfp
 * Python 2.7 is not required.  Python 2.6 is no longer officially supported.
   The code base is now also `python2.7 -3` clean, although there are still
   some warnings in 3rd party dependencies.  LP: #1073506

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
    def test_delete_bogus_user(self):
47
47
        # Try to delete a user that does not exist.
48
 
        try:
49
 
            # For Python 2.6.
 
48
        with self.assertRaises(HTTPError) as cm:
50
49
            call_api('http://localhost:9001/3.0/users/99', method='DELETE')
51
 
        except HTTPError as exc:
52
 
            self.assertEqual(exc.code, 404)
53
 
        else:
54
 
            raise AssertionError('Expected HTTPError')
 
50
        self.assertEqual(cm.exception.code, 404)