'Test iterable as query argument.'

def test_issue_321(self):

    conn = pymysql.connect(charset='utf8', **self.databases[0])
    self.safe_create_table(conn, 'issue321', 'create    table    issue321    (value_1    varchar(1),    value_2    varchar(1))')
    sql_insert = 'insert    into    issue321    (value_1,    value_2)    values    (%s,    %s)'
    sql_dict_insert = 'insert    into    issue321    (value_1,    value_2)    values    (%(value_1)s,    %(value_2)s)'
    sql_select = 'select    *    from    issue321    where    value_1    in    %s    and    value_2=%s'
    data = [[(u'a',), u'\u0430'], [[u'b'], u'\u0430'], {'value_1': [[u'c']], 'value_2': u'\u0430'}]
    cur = conn.cursor()
    self.assertEqual(cur.execute(sql_insert, data[0]), 1)
    self.assertEqual(cur.execute(sql_insert, data[1]), 1)
    self.assertEqual(cur.execute(sql_dict_insert, data[2]), 1)
    self.assertEqual(cur.execute(sql_select, [(u'a', u'b', u'c'), u'\u0430']), 3)
    self.assertEqual(cur.fetchone(), (u'a', u'\u0430'))
    self.assertEqual(cur.fetchone(), (u'b', u'\u0430'))
    self.assertEqual(cur.fetchone(), (u'c', u'\u0430'))
