def teardownDatabase():
    DBSession.rollback()
    metadata.drop_all(engine)
def setup_database_with_translations():
    init_model(engine)
    teardownDatabase()
    metadata.create_all(engine)
    
    # Creating members

    member = Member()
    member.member_name = u'rms'
    member.password = u'freedom'
    DBSession.add(member)

    member = Member()
    member.member_name = u'linus'
    member.password = u'linux'
    DBSession.add(member)

    member = Member()
    member.member_name = u'sballmer'
    member.password = u'developers'
    DBSession.add(member)

    # Plus a couple of members without groups
    member = Member()
    member.member_name = u'guido'
    member.password = u'phytonic'
    DBSession.add(member)

    member = Member()
    member.member_name = u'rasmus'
    member.password = u'php'
    DBSession.add(member)

    DBSession.commit()
def setup_database():
    init_model(engine)
    teardownDatabase()
    metadata.create_all(engine)
    
    # Creating users

    user = User()
    user.user_name = u'rms'
    user.password = u'freedom'
    DBSession.add(user)

    user = User()
    user.user_name = u'linus'
    user.password = u'linux'
    DBSession.add(user)

    user = User()
    user.user_name = u'sballmer'
    user.password = u'developers'
    DBSession.add(user)

    # Plus a couple of users without groups
    user = User()
    user.user_name = u'guido'
    user.password = u'phytonic'
    DBSession.add(user)

    user = User()
    user.user_name = u'rasmus'
    user.password = u'php'
    DBSession.add(user)

    DBSession.commit()
def setup_database_with_translations():
    init_model(engine)
    teardownDatabase()
    metadata.create_all(engine)

    # Creating members

    member = Member()
    member.member_name = u'rms'
    member.password = u'freedom'
    DBSession.save(member)

    member = Member()
    member.member_name = u'linus'
    member.password = u'linux'
    DBSession.save(member)

    member = Member()
    member.member_name = u'sballmer'
    member.password = u'developers'
    DBSession.save(member)

    # Plus a couple of members without groups
    member = Member()
    member.member_name = u'guido'
    member.password = u'phytonic'
    DBSession.save(member)

    member = Member()
    member.member_name = u'rasmus'
    member.password = u'php'
    DBSession.save(member)

    DBSession.commit()
def setup_database():
    init_model(engine)
    teardownDatabase()
    metadata.create_all(engine)

    # Creating users

    user = User()
    user.user_name = u'rms'
    user.password = u'freedom'
    DBSession.save(user)

    user = User()
    user.user_name = u'linus'
    user.password = u'linux'
    DBSession.save(user)

    user = User()
    user.user_name = u'sballmer'
    user.password = u'developers'
    DBSession.save(user)

    # Plus a couple of users without groups
    user = User()
    user.user_name = u'guido'
    user.password = u'phytonic'
    DBSession.save(user)

    user = User()
    user.user_name = u'rasmus'
    user.password = u'php'
    DBSession.save(user)

    DBSession.commit()
def teardownDatabase():
    DBSession.rollback()
    metadata.drop_all(engine)