Projet

Général

Profil

0004-misc-fix-wrong-import-position-pylint-error-56288.patch

Lauréline Guérin, 30 août 2021 17:53

Télécharger (3,34 ko)

Voir les différences:

Subject: [PATCH 04/31] misc: fix wrong-import-position pylint error (#56288)

 combo/public/views.py   | 10 +++++-----
 combo/wsgi.py           |  4 ++--
 tests/settings.py       |  4 ++--
 tests/test_dashboard.py |  4 ++--
 tests/test_public.py    |  4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)
combo/public/views.py
46 46
from django.views.decorators.csrf import csrf_exempt
47 47
from django.views.defaults import page_not_found
48 48

  
49
if 'mellon' in settings.INSTALLED_APPS:
50
    from mellon.utils import get_idps
51
else:
52
    get_idps = lambda: []
53

  
54 49
from combo import utils
55 50
from combo.apps.assets.models import Asset
56 51
from combo.data.models import (
......
66 61
from combo.profile.models import Profile
67 62
from combo.profile.utils import get_user_from_name_id
68 63

  
64
if 'mellon' in settings.INSTALLED_APPS:
65
    from mellon.utils import get_idps
66
else:
67
    get_idps = lambda: []
68

  
69 69

  
70 70
class LoginView(auth_views.LoginView):
71 71
    def dispatch(self, request, *args, **kwargs):
combo/wsgi.py
9 9

  
10 10
import os
11 11

  
12
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "combo.settings")
13

  
14 12
from django.conf import settings
15 13
from django.core.wsgi import get_wsgi_application
16 14

  
15
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "combo.settings")
16

  
17 17
application = get_wsgi_application()
18 18
if 'hobo.context_processors.statics_hash' in settings.TEMPLATES[0]['OPTIONS']['context_processors']:
19 19
    # initialize versions as soon as possible as it may be used in most
tests/settings.py
1
import tempfile
2

  
1 3
DATABASES = {
2 4
    'default': {
3 5
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.postgresql_psycopg2'),
......
62 64

  
63 65
COMBO_DASHBOARD_ENABLED = True
64 66

  
65
import tempfile
66

  
67 67
MEDIA_ROOT = tempfile.mkdtemp('combo-test')
68 68

  
69 69
if 'DISABLE_MIGRATIONS' in os.environ:
tests/test_dashboard.py
14 14
from combo.apps.dashboard.models import DashboardCell, Tile
15 15
from combo.data.models import Page, TextCell
16 16

  
17
pytestmark = pytest.mark.django_db
18

  
19 17
from .test_manager import login
20 18

  
19
pytestmark = pytest.mark.django_db
20

  
21 21

  
22 22
@pytest.fixture
23 23
def site(admin_user):
tests/test_public.py
36 36
    TextCell,
37 37
)
38 38

  
39
pytestmark = pytest.mark.django_db
40

  
41 39
from .test_manager import login
42 40

  
41
pytestmark = pytest.mark.django_db
42

  
43 43

  
44 44
def test_missing_index(app):
45 45
    Page.objects.all().delete()
46
-