def setUp(self): import muesli import sqlalchemy self.config = muesli.config databaseName = muesli.config['database']['connection'] databaseName = databaseName + "test" self.engine = sqlalchemy.create_engine(databaseName) import muesli.models muesli.models.Base.metadata.create_all(self.engine) muesli.mailerName = 'pyramid_mailer.testing' muesli.mail.testing=True muesli.old_engine = muesli.engine muesli.engine = lambda: self.engine import muesli.web from muesli.web import main self.app = main({}) from webtest import TestApp self.testapp = TestApp(self.app) self.session = muesli.models.Session() for table in reversed(muesli.models.Base.metadata.sorted_tables): self.session.execute(table.delete()) self.session.commit() self.populate()
def setUp(self): import muesli import sqlalchemy self.config = muesli.config databaseName = muesli.config['database']['connection'] databaseName = databaseName + "test" self.engine = sqlalchemy.create_engine(databaseName) import muesli.models muesli.models.Base.metadata.create_all(self.engine) muesli.mailerName = 'pyramid_mailer.testing' muesli.mail.testing = True muesli.old_engine = muesli.engine muesli.engine = lambda: self.engine import muesli.web from muesli.web import main self.app = main({}) from webtest import TestApp self.testapp = TestApp(self.app) self.session = muesli.models.Session() # TODO: This makes it incredibly hard to setup new testcases. # Since you cant just modify the sql image but have to change the # values in the PopulatedTests.populate() function -.- for table in reversed(muesli.models.Base.metadata.sorted_tables): self.session.execute(table.delete()) self.populate() self.session.commit()
def setUp(self): import muesli import sqlalchemy self.engine = sqlalchemy.create_engine('postgresql:///mueslitest') self.config = muesli.config import muesli.models muesli.models.Base.metadata.create_all(self.engine) muesli.mailerName = 'pyramid_mailer.testing' muesli.mail.testing=True muesli.old_engine = muesli.engine muesli.engine = lambda: self.engine import muesli.web from muesli.web import main self.app = main({}) from webtest import TestApp self.testapp = TestApp(self.app) self.session = muesli.models.Session() for table in reversed(muesli.models.Base.metadata.sorted_tables): self.session.execute(table.delete()) self.session.commit() self.populate()
def setUp(self): import muesli.web from muesli.web import main app = main({}, testmode=True) from webtest import TestApp self.testapp = TestApp(app)
def setUp(self): import muesli.web from muesli.web import main app = main({}) from webtest import TestApp self.testapp = TestApp(app)