server/test/unittest_migractions.py
changeset 1251 af40e615dc89
parent 972 1efba3fd1364
child 1263 01152fffd593
--- a/server/test/unittest_migractions.py	Mon Apr 06 16:11:38 2009 +0200
+++ b/server/test/unittest_migractions.py	Mon Apr 06 16:18:46 2009 +0200
@@ -6,6 +6,8 @@
 from logilab.common.testlib import TestCase, unittest_main
 from cubicweb.devtools.apptest import RepositoryBasedTC, get_versions
 
+from cubicweb.schema import CubicWebSchemaLoader
+from cubicweb.server.sqlutils import SQL_PREFIX
 from cubicweb.server.repository import Repository
 from cubicweb.server.migractions import *
 
@@ -29,7 +31,6 @@
             repo.config._cubes = None
             repo.fill_schema()
             # hack to read the schema from data/migrschema
-            from cubicweb.schema import CubicWebSchemaLoader
             CubicWebSchemaLoader.main_schema_directory = 'migrschema'
             global migrschema
             migrschema = self.repo.config.load_schema()
@@ -68,9 +69,9 @@
         self.assertEquals(self.schema['shortpara'].subjects(), ('Note', ))
         self.assertEquals(self.schema['shortpara'].objects(), ('String', ))
         # test created column is actually a varchar(64)
-        notesql = self.mh.sqlexec("SELECT sql FROM sqlite_master WHERE type='table' and name='Note'")[0][0]
+        notesql = self.mh.sqlexec("SELECT sql FROM sqlite_master WHERE type='table' and name='%sNote'" % SQL_PREFIX)[0][0]
         fields = dict(x.strip().split()[:2] for x in notesql.split('(', 1)[1].rsplit(')', 1)[0].split(','))
-        self.assertEquals(fields['shortpara'], 'varchar(64)')
+        self.assertEquals(fields['%sshortpara' % SQL_PREFIX], 'varchar(64)')
         self.mh.rollback()
         
     def test_add_datetime_with_default_value_attribute(self):