  
          q = QueryDict(str('vote=yes&vote=no'))
  
          self.assertEqual(q['vote'], 'no')
          self.assertRaises(AttributeError, q.__setitem__, 'something', 'bar')
  
          self.assertEqual(q.get('vote', 'default'), 'no')
          self.assertEqual(q.get('foo', 'default'), 'default')
          self.assertEqual(q.getlist('vote'), ['yes', 'no'])
          self.assertEqual(q.getlist('foo'), [])
 
</s> remove         self.assertRaises(KeyError, q.__getitem__, 'bar')
        self.assertRaises(AttributeError, q.__setitem__, 'something', 'bar')
 </s> add         with self.assertRaises(KeyError):
            q.__getitem__('bar')
        with self.assertRaises(AttributeError):
            q.__setitem__('something', 'bar') </s> remove         self.assertRaises(AttributeError, q.setlist, 'foo', ['bar', 'baz'])
        self.assertRaises(AttributeError, q.setlist, 'foo', ['bar', 'baz'])
        self.assertRaises(AttributeError, q.appendlist, 'foo', ['bar'])
 </s> add         with self.assertRaises(AttributeError):
            q.setlist('foo', ['bar', 'baz'])
        with self.assertRaises(AttributeError):
            q.setlist('foo', ['bar', 'baz'])
        with self.assertRaises(AttributeError):
            q.appendlist('foo', ['bar']) </s> remove         self.assertRaises(AttributeError, q.__setitem__, 'something', 'bar')
        self.assertRaises(AttributeError, q.setlist, 'foo', ['bar'])
        self.assertRaises(AttributeError, q.appendlist, 'foo', ['bar'])
        self.assertRaises(AttributeError, q.update, {'foo': 'bar'})
        self.assertRaises(AttributeError, q.pop, 'foo')
        self.assertRaises(AttributeError, q.popitem)
        self.assertRaises(AttributeError, q.clear)
 </s> add         with self.assertRaises(AttributeError):
            q.__setitem__('something', 'bar')
        with self.assertRaises(AttributeError):
            q.setlist('foo', ['bar'])
        with self.assertRaises(AttributeError):
            q.appendlist('foo', ['bar'])
        with self.assertRaises(AttributeError):
            q.update({'foo': 'bar'})
        with self.assertRaises(AttributeError):
            q.pop('foo')
        with self.assertRaises(AttributeError):
            q.popitem()
        with self.assertRaises(AttributeError):
            q.clear() </s> remove         self.assertRaises(KeyError, q.__getitem__, 'foo')
 </s> add         with self.assertRaises(KeyError):
            q.__getitem__('foo') </s> remove         self.assertRaises(AttributeError, q.setlist, 'foo', ['bar'])
        self.assertRaises(AttributeError, q.appendlist, 'foo', ['bar'])
 </s> add         with self.assertRaises(AttributeError):
            q.setlist('foo', ['bar'])
        with self.assertRaises(AttributeError):
            q.appendlist('foo', ['bar'])
        with self.assertRaises(AttributeError):
            q.__setitem__('something', 'bar')
  
          q = QueryDict(str('vote=yes&vote=no'))
  
          self.assertEqual(q['vote'], 'no')
        with self.assertRaises(AttributeError):
            q.__setitem__('something', 'bar')
  
          self.assertEqual(q.get('vote', 'default'), 'no')
          self.assertEqual(q.get('foo', 'default'), 'default')
          self.assertEqual(q.getlist('vote'), ['yes', 'no'])
          self.assertEqual(q.getlist('foo'), [])
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/httpwrappers/tests.py