From 45701b248b93f3c40d11a622ed1411800aef0e99 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Fri, 15 Apr 2022 16:59:30 +0200 Subject: [PATCH] fix code style --- pyproject.toml | 1 + tests/test_django_project.py | 16 ++++++++-------- tests/test_project_setup.py | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 047ed78..76b9aae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ atomic=true profile='black' line_length=100 skip_glob=["*/htmlcov/*","*/migrations/*"] +known_first_party=["for_runners"] lines_after_imports=2 diff --git a/tests/test_django_project.py b/tests/test_django_project.py index 9d4bfbc..c48af1f 100644 --- a/tests/test_django_project.py +++ b/tests/test_django_project.py @@ -39,9 +39,9 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase): # TODO: https://github.com/jedie/django-for-runners/issues/25 # Serve user uploads via django_tools.serve_media_app: # assert settings.MEDIA_URL == '/app_path/media/' - # assert reverse('serve_media_app:serve-media', kwargs={'user_token': 'token', 'path': 'foo/bar/'}) == ( - # '/app_path/media/token/foo/bar/' - # ) + # assert reverse( + # 'serve_media_app:serve-media', kwargs={'user_token': 'token', 'path': 'foo/bar/'} + # ) == ('/app_path/media/token/foo/bar/') def test_auth(self): # SecurityMiddleware should redirects all non-HTTPS requests to HTTPS: @@ -51,14 +51,12 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase): response, status_code=301, # permanent redirect expected_url='https://testserver/app_path/', - fetch_redirect_response=False + fetch_redirect_response=False, ) response = self.client.get('/app_path/', secure=True) self.assertRedirects( - response, - expected_url='/app_path/login/?next=/app_path/', - fetch_redirect_response=False + response, expected_url='/app_path/login/?next=/app_path/', fetch_redirect_response=False ) @override_settings(SECURE_SSL_REDIRECT=False) @@ -150,7 +148,9 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase): path='/app_path/', HTTP_REMOTE_USER='test', HTTP_AUTH_USER='test', - HTTP_AUTHORIZATION=generate_basic_auth(username='foobar', password='test123'), # <<< wrong user name + HTTP_AUTHORIZATION=generate_basic_auth( + username='foobar', password='test123' + ), # <<< wrong user name ) assert User.objects.count() == 1 diff --git a/tests/test_project_setup.py b/tests/test_project_setup.py index 2bb75b7..afb09c3 100644 --- a/tests/test_project_setup.py +++ b/tests/test_project_setup.py @@ -4,10 +4,11 @@ import shutil import subprocess from pathlib import Path -import for_runners from bx_django_utils.filename import clean_filename from bx_py_utils.path import assert_is_dir, assert_is_file +import for_runners + PACKAGE_ROOT = Path(__file__).parent.parent