mirror of
https://github.com/YunoHost-Apps/django-for-runners_ynh.git
synced 2024-09-03 18:26:16 +02:00
fix code style
This commit is contained in:
parent
5a7500c95f
commit
45701b248b
3 changed files with 11 additions and 9 deletions
|
@ -64,6 +64,7 @@ atomic=true
|
|||
profile='black'
|
||||
line_length=100
|
||||
skip_glob=["*/htmlcov/*","*/migrations/*"]
|
||||
known_first_party=["for_runners"]
|
||||
lines_after_imports=2
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue