def test_delete_queue(self): request = Request(post={'token': 't', 'domain': 'x.com'}) queue = filter(None, views.new_queue(request)['queue'].split('/'))[-1] request = Request(params={'token': 't'}, matchdict={'queue': queue}) views.delete_queue(request) eq_(views.get_queues(Request(params={'token': 't'})), {})
def test_delete_queue_404(self): request = Request(post={'token': 't', 'domain': 'x.com'}) queue = filter(None, views.new_queue(request)['queue'].split('/'))[-1] # A valid token with an invalid queue gets a 404. request = Request(params={'token': 't'}, matchdict={'queue': 'x'}) eq_(views.delete_queue(request).code, 404) # An invalid token with a valid queue gets a 404. request = Request(params={'token': 'x'}, matchdict={'queue': queue}) eq_(views.delete_queue(request).code, 404)