# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from os.path import abspath, dirname, join
import tempfile
from traceback import extract_stack
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from os.path import abspath, dirname, join
import tempfile
from traceback import extract_stack
from django.test import TestCase
from django.test.utils import override_settings
from slugify import slugify
from librarian import WLURI
from django.test import TestCase
from django.test.utils import override_settings
from slugify import slugify
from librarian import WLURI
@override_settings(
MEDIA_ROOT=tempfile.mkdtemp(prefix='djangotest_'),
CATALOGUE_DONT_BUILD={'pdf', 'mobi', 'epub', 'txt', 'fb2', 'cover'},
NO_SEARCH_INDEX=True,
@override_settings(
MEDIA_ROOT=tempfile.mkdtemp(prefix='djangotest_'),
CATALOGUE_DONT_BUILD={'pdf', 'mobi', 'epub', 'txt', 'fb2', 'cover'},
NO_SEARCH_INDEX=True,
def __init__(self, first_names, last_name):
self.first_names = first_names
def __init__(self, first_names, last_name):
self.first_names = first_names
_empty_fields = ['cover_url', 'variant_of']
# allow single definition for multiple-value fields
_salias = {
_empty_fields = ['cover_url', 'variant_of']
# allow single definition for multiple-value fields
_salias = {
def info_args(title, language=None):
""" generate some keywords for comfortable BookInfoCreation """
def info_args(title, language=None):
""" generate some keywords for comfortable BookInfoCreation """
mod_path = extract_stack(limit=2)[0][0]
f_path = join(dirname(abspath(mod_path)), 'files', path)
return f_path
mod_path = extract_stack(limit=2)[0][0]
f_path = join(dirname(abspath(mod_path)), 'files', path)
return f_path