def test_create_database_with_reload(self): self.db.create_table("foo", "value int, name varchar(128)") self.db.reload() y = orm.quick_load('postgres', host='localhost', user='******', database='orm_test_db') assert 'foo' in self.db.tables assert 'foo' in y.tables
def test_create_database_with_reload(self): filename = self.db.init_kwargs["filename"] self.db.create_table("foo", "value int, name varchar(128)") self.db.reload() y = orm.quick_load("sqlite", filename=filename) assert "foo" in self.db.tables assert "foo" in y.tables
def setUp(self): self.db = orm.quick_load('postgres', host='localhost', user='******', database='orm_test_db') assert self.db.has_no_tables() == True
import unittest import time import orm import orm.unit_tests import sys if orm.unit_tests.db_type == 'sqlite': my_db = orm.temp_db('foo') elif orm.unit_tests.db_type == 'postgres': my_db = orm.quick_load('postgres', host='127.0.0.1', user='******', database='orm_test_db') else: my_db = orm.temp_db('foo') class Test_MyTest(unittest.TestCase): def setUp(self): self.db = my_db assert self.db.has_no_tables() == True def tearDown(self): self.db.drop_all_tables() assert self.db.has_no_tables() == True