95 ((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py'), |
95 ((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py'), |
96 ((0, 1 ,0), TMIGRDIR+'0.1.0_web.py')]) |
96 ((0, 1 ,0), TMIGRDIR+'0.1.0_web.py')]) |
97 config.__class__.name = 'repository' |
97 config.__class__.name = 'repository' |
98 |
98 |
99 |
99 |
100 from cubicweb.devtools import ApptestConfiguration, init_test_database, cleanup_sqlite |
100 from cubicweb.devtools import ApptestConfiguration, get_test_db_handler |
101 |
101 |
102 class BaseCreationTC(TestCase): |
102 class BaseCreationTC(TestCase): |
103 |
103 |
104 def test_db_creation(self): |
104 def test_db_creation(self): |
105 """make sure database can be created""" |
105 """make sure database can be created""" |
106 config = ApptestConfiguration('data', apphome=self.datadir) |
106 config = ApptestConfiguration('data', apphome=self.datadir) |
107 source = config.sources()['system'] |
107 source = config.sources()['system'] |
108 self.assertEqual(source['db-driver'], 'sqlite') |
108 self.assertEqual(source['db-driver'], 'sqlite') |
109 cleanup_sqlite(source['db-name'], removetemplate=True) |
109 handler = get_test_db_handler(config) |
110 init_test_database(config=config) |
110 handler.init_test_database() |
111 |
111 |
112 |
112 |
113 if __name__ == '__main__': |
113 if __name__ == '__main__': |
114 unittest_main() |
114 unittest_main() |