Get the frontend unittest to run against SQLite.  This required scattered changes:
* change frontend_unittest to tell django to use an in-memory SQLite database. ideally this would've been the only change necessary, but it wasn't.
* change long to ints in the doctests, as that's what pysqlite2 returns
* change several imports to use autotest_lib; that's the way everything should be, and the other way breaks things when trying to run stuff without using manage.py
* make readonly_connection better support testing by changing its connection attribute into a method, and adding the capability to disable the module completely during testing
* get rid of use of GROUP_CONCAT in models.py; SQLite doesn't support it (not in our old version anyhow), and it;s really not necessary anyway



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2244 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/new_tko/tko/models.py b/new_tko/tko/models.py
index 8861b84..d20fcd1 100644
--- a/new_tko/tko/models.py
+++ b/new_tko/tko/models.py
@@ -51,7 +51,7 @@
         """
         sql, params = self._get_group_query_sql(query, group_by,
                                                 extra_select_fields)
-        cursor = readonly_connection.connection.cursor()
+        cursor = readonly_connection.connection().cursor()
         cursor.execute(sql, params)
         field_names = [column_info[0] for column_info in cursor.description]
         row_dicts = [dict(zip(field_names, row)) for row in cursor.fetchall()]
@@ -86,7 +86,7 @@
         fields in group_by.
         """
         sql, params = self._get_num_groups_sql(query, group_by)
-        cursor = readonly_connection.connection.cursor()
+        cursor = readonly_connection.connection().cursor()
         cursor.execute(sql, params)
         return cursor.fetchone()[0]
 
@@ -375,7 +375,7 @@
         else:
             distinct = ''
         sql_query = 'SELECT ' + distinct + ','.join(selects) + where
-        cursor = readonly_connection.connection.cursor()
+        cursor = readonly_connection.connection().cursor()
         cursor.execute(sql_query, params)
         return cursor.fetchall()