try to make pylint happy
All checks were successful
buildbot/tox Build done.

This commit is contained in:
2022-06-08 00:08:09 +02:00
parent 8610e2a557
commit 98a6fc3ce7
60 changed files with 565 additions and 560 deletions

4
tests/settings.py Normal file
View File

@@ -0,0 +1,4 @@
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent
SECRET_KEY = 'fake-key'

View File

@@ -1,19 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import django
import os
import shutil
import sys
import django
from django.test.utils import get_runner
#from dav_base.console_scripts.admin import DJANGO_MAIN_MODULE
DJANGO_MAIN_MODULE = 'main'
from dav_base.tests.utils import mkdtemp
# from dav_base.console_scripts.admin import DJANGO_MAIN_MODULE
DJANGO_MAIN_MODULE = 'main'
class DjangoEnvironment(object):
class DjangoEnvironment:
@staticmethod
def _install_djangoproject(path, modules=None):
cmd = 'django-dav-admin setup "{}"'.format(path)
@@ -35,6 +35,8 @@ class DjangoEnvironment(object):
else:
self._enable_modules = []
self.settings = None
def __enter__(self):
if self.path is None:
prefix = 'testrun-{datetime}-'.format(
@@ -51,7 +53,7 @@ class DjangoEnvironment(object):
os.environ['DJANGO_SETTINGS_MODULE'] = '{}.settings'.format(DJANGO_MAIN_MODULE)
django.setup()
from django.conf import settings
from django.conf import settings # pylint: disable=import-outside-toplevel
self.settings = settings
return self
@@ -64,7 +66,7 @@ class DjangoEnvironment(object):
shutil.rmtree(self.path)
class TestSuite(object):
class TestSuite:
@staticmethod
def run():
modules = ['dav_auth', 'dav_events', 'dav_registration', 'dav_event_office']