Exemplo n.º 1
0
def setUpDatastorage(test):
    setUpCA(test)

    config.addPackage('memphis.storage.meta')
    config.loadPackage('memphis.config')

    engine = create_engine('sqlite://')
    Session = sessionmaker()
    Session.configure(bind=engine)

    session = Session()

    config.begin()
    storage.setMetadata(sqlalchemy.MetaData())
    storage.initialize(engine, session)

    config.commit()
    session.commit()
Exemplo n.º 2
0
def setUp(test):
    config.loadPackage('ploud.frontend')

    testing.setUpConfig(test)
    testing.setUpTestAsModule(test, 'ploud.TESTS')
    ploud.TESTS = sys.modules['ploud.TESTS']

    initialize_sql('sqlite://')

    smtplib.SMTP = SMTP

    global configFile
    hnd, configFile = tempfile.mkstemp()
    f = open(configFile, 'wb')
    f.write("""[frontend]\nregistration=true""")
    f.close()
    ploud_config.initializeConfig(configFile, True)

    pyramid_config = Configurator()
    pyramid_config.begin()
Exemplo n.º 3
0
def setUp(test):
    config.loadPackage('memphis.contenttype')
    setUpDatastorage(test)
    setUpTestAsModule(test, 'memphis.TESTS')