'Test for inserting a large text field
test_large_text tests inserting a large text field into a row.
@expected_result the large text value should be inserted. When the row is queried it should match the original
value that was inserted
@test_category queries'

def test_large_text(self):

    table = 'large_text'
    session = self.make_session_and_keyspace()
    session.execute(('CREATE    TABLE    %s    (k    int    PRIMARY    KEY,    txt    text)' % table))
    text = ('a' * 1000000)
    session.execute(SimpleStatement(("INSERT    INTO    %s    (k,    txt)    VALUES    (%s,    '%s')" % (table, 0, text)), consistency_level=ConsistencyLevel.QUORUM))
    result = session.execute(('SELECT    *    FROM    %s    WHERE    k=%s' % (table, 0)))
    found_result = False
    for (i, row) in enumerate(result):
        self.assertEqual(row['txt'], text)
        found_result = True
    self.assertTrue(found_result, 'No    results    were    found')
    session.cluster.shutdown()
