~rashi007/mailman/docsfix

« back to all changes in this revision

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

  • Committer: Barry Warsaw
  • Date: 2015-02-06 03:53:56 UTC
  • Revision ID: barry@list.org-20150206035356-ufia0ei1rm6qfzkj
 * You can now DELETE an address.  If the address is linked to a user, the
   user is not delete, it is just unlinked.

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
        anne_addr = user_manager.get_address('anne@example.com')
383
383
        self.assertIsNotNone(anne_addr)
384
384
        self.assertEqual(anne_addr.user, anne_person)
 
385
 
 
386
    def test_delete_missing_address(self):
 
387
        # DELETEing an address through the REST API that doesn't exist returns
 
388
        # a 404 error.
 
389
        with self.assertRaises(HTTPError) as cm:
 
390
            response, headers = call_api(
 
391
                'http://localhost:9001/3.0/addresses/anne@example.com',
 
392
                method='DELETE')
 
393
        self.assertEqual(cm.exception.code, 404)