def track_unicode_special(DBSession, commit): tags_data = ( 'title:UnicodeAssention', 'from:Hack//Sign', 'artist:こ', ) def _create_tag(tag_data): tag = get_tag(tag_data, create_if_missing=True) DBSession.add(tag) return tag tag_objs = tuple(_create_tag(tag) for tag in tags_data) commit() track = Track() track.id = 'x999' track.duration = 120 track.tags[:] = tag_objs track.source_filename = 'unicode_special' DBSession.add(track) commit() yield track DBSession.delete(track) for tag_obj in tag_objs: DBSession.delete(tag_obj) commit()
def queue(request, DBSession, commit): QUEUE_ID = 'qtest' queue = Queue(id=QUEUE_ID) DBSession.add(queue) queue_setting = QueueSetting() queue_setting.queue_id = QUEUE_ID queue_setting.key = 'karakara.private.password' queue_setting.value = QUEUE_ID DBSession.add(queue_setting) commit() cache.invalidate() yield QUEUE_ID DBSession.delete(queue)
def queue(request, DBSession, commit, cache_store): QUEUE_ID = 'qtest' queue = Queue(id=QUEUE_ID) DBSession.add(queue) queue_setting = QueueSetting() queue_setting.queue_id = QUEUE_ID queue_setting.key = 'karakara.private.password' queue_setting.value = QUEUE_ID DBSession.add(queue_setting) commit() cache_store.invalidate() yield QUEUE_ID DBSession.delete(queue)
def finalizer(): for track in mock_tracks: DBSession.delete(track) commit()
def finalizer(): for attachment in attachments: DBSession.delete(attachment) commit()