Commit 670b595d authored by Diederik van der Boor's avatar Diederik van der Boor
Browse files

PEP8 (except line length)

parent 495791cb
......@@ -6,13 +6,14 @@ import django
from django.conf import settings
from django.core.management import call_command
def main():
if not settings.configured:
module_root = path.dirname(path.realpath(__file__))
settings.configure(
DEBUG = False,
INSTALLED_APPS = (
DEBUG=False,
INSTALLED_APPS=(
'private_storage',
),
)
......@@ -20,9 +21,11 @@ def main():
django.setup()
makemessages()
def makemessages():
os.chdir('private_storage')
call_command('makemessages', locale=('en', 'nl'), verbosity=1)
if __name__ == '__main__':
main()
......@@ -19,7 +19,6 @@ from django.utils.encoding import force_str, force_text
logger = logging.getLogger(__name__)
class PrivateFileField(models.FileField):
"""
Filefield with private storage, custom filename and size checks.
......
......@@ -19,6 +19,7 @@ class PrivateFileSystemStorage(FileSystemStorage):
Interface to the Django storage system,
storing the files in a private folder.
"""
def __init__(self, location=None, base_url=None, **kwargs):
if location is None:
location = appconfig.PRIVATE_STORAGE_ROOT
......
......@@ -10,18 +10,18 @@ if not settings.configured:
sys.path.insert(0, path.join(module_root, 'example'))
settings.configure(
DEBUG = False, # will be False anyway by DjangoTestRunner.
DATABASES = {
DEBUG=False, # will be False anyway by DjangoTestRunner.
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
INSTALLED_APPS = (
INSTALLED_APPS=(
'private_storage',
),
TEST_RUNNER = 'django.test.runner.DiscoverRunner',
TEMPLATES = [
TEST_RUNNER='django.test.runner.DiscoverRunner',
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': (),
......@@ -49,5 +49,6 @@ def runtests():
argv = sys.argv[:1] + ['test', 'private_storage'] + sys.argv[1:]
execute_from_command_line(argv)
if __name__ == '__main__':
runtests()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment