def setUp(self): self.testapp = TestApp(main( {}, **{ 'sqlalchemy.url': os.environ.get('DB', 'sqlite://'), 'secret.authn_policy':'so_secret', 'secret.unencrypted_cookie':'itsaseekreet', 'mako.directories':'pyconca:templates', } )) Base.metadata.drop_all(DBSession.bind) Base.metadata.create_all(DBSession.bind) with transaction.manager: self._admin_id = 1 self._speaker_id = 2 self._admin_talk_id = 11 self._speaker_talk_id = 12 self._schedule_slot_id = 21 admin = User(id=self._admin_id, username='******', password='******', first_name='Admin', last_name='Istrator', email='*****@*****.**') speaker = User(id=self._speaker_id, username='******', password='******', first_name='Spe', last_name='Aker', email='*****@*****.**') admin_group = Group(name='admin') admin.groups.append(admin_group) admin_talk = Talk(id=self._admin_talk_id, owner_id=self._admin_id, title="atitle", type="talk", level="novice", abstract="aabstract", outline="aoutline", reviewer_notes="areviewer_notes") speaker_talk = Talk(id=self._speaker_talk_id, owner_id=self._speaker_id, title="stitle", type="tutorial", level="experienced", abstract="sabstract", outline="soutline", reviewer_notes="sreviewer_notes") start = datetime(2012, 11, 10, 15, 00) end = datetime(2012,11,10,15,30) schedule_slot = ScheduleSlot(id=self._schedule_slot_id, room="room", start=start, end=end, code="X%s" %(self._schedule_slot_id, )) DBSession.add_all([admin, speaker, admin_group, admin_talk, speaker_talk, schedule_slot])
def setUp(self): self.testapp = TestApp(main( {}, **{ 'sqlalchemy.url': os.environ.get('DB', 'sqlite://'), 'secret.authn_policy':'so_secret', 'secret.unencrypted_cookie':'itsaseekreet', 'mako.directories':'pyconca:templates', } )) Base.metadata.drop_all(DBSession.bind) Base.metadata.create_all(DBSession.bind) with transaction.manager: self._admin_id = 1 self._speaker_id = 2 self._admin_talk_id = 11 self._speaker_talk_id = 12 self._schedule_slot_id = 21 admin = User(id=self._admin_id, username='******', password='******', first_name='Admin', last_name='Istrator', email='*****@*****.**') speaker = User(id=self._speaker_id, username='******', password='******', first_name='Spe', last_name='Aker', email='*****@*****.**') admin_group = Group(name='admin') admin.groups.append(admin_group) admin_talk = Talk(id=self._admin_talk_id, owner_id=self._admin_id, title="atitle", type="talk", level="novice", abstract="aabstract", outline="aoutline", reviewer_notes="areviewer_notes") speaker_talk = Talk(id=self._speaker_talk_id, owner_id=self._speaker_id, title="stitle", type="tutorial", level="experienced", abstract="sabstract", outline="soutline", reviewer_notes="sreviewer_notes") start = datetime(2012, 11, 10, 15, 00) end = datetime(2012,11,10,15,30) schedule_slot = ScheduleSlot(id=self._schedule_slot_id, room="room", start=start, end=end) DBSession.add_all([admin, speaker, admin_group, admin_talk, speaker_talk, schedule_slot])