'Test QueryDict with two key/value pairs with same keys.'

def test_multiple_keys(self):

    q = QueryDict('vote=yes&vote=no')
    self.assertEqual(q['vote'], u'no')
    self.assertRaises(AttributeError, q.__setitem__, 'something', 'bar')
    self.assertEqual(q.get('vote', 'default'), u'no')
    self.assertEqual(q.get('foo', 'default'), 'default')
    self.assertEqual(q.getlist('vote'), [u'yes', u'no'])
    self.assertEqual(q.getlist('foo'), [])
    self.assertRaises(AttributeError, q.setlist, 'foo', ['bar', 'baz'])
    self.assertRaises(AttributeError, q.setlist, 'foo', ['bar', 'baz'])
    self.assertRaises(AttributeError, q.appendlist, 'foo', ['bar'])
    self.assertEqual(q.has_key('vote'), True)
    self.assertEqual(('vote' in q), True)
    self.assertEqual(q.has_key('foo'), False)
    self.assertEqual(('foo' in q), False)
    self.assertEqual(q.items(), [(u'vote', u'no')])
    self.assertEqual(q.lists(), [(u'vote', [u'yes', u'no'])])
    self.assertEqual(q.keys(), [u'vote'])
    self.assertEqual(q.values(), [u'no'])
    self.assertEqual(len(q), 1)
    self.assertRaises(AttributeError, q.update, {'foo': 'bar'})
    self.assertRaises(AttributeError, q.pop, 'foo')
    self.assertRaises(AttributeError, q.popitem)
    self.assertRaises(AttributeError, q.clear)
    self.assertRaises(AttributeError, q.setdefault, 'foo', 'bar')
    self.assertRaises(AttributeError, q.__delitem__, 'vote')
