From 8e8a3a526fca156e4f7f19db5a106568cd3d210d Mon Sep 17 00:00:00 2001 From: ptitloup Date: Wed, 17 Nov 2021 11:46:00 +0100 Subject: [PATCH] fix flake8 in tests files --- pod/authentication/tests/test_populated.py | 9 ++++++--- pod/playlist/tests/test_views.py | 3 ++- pod/video/tests/test_views.py | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pod/authentication/tests/test_populated.py b/pod/authentication/tests/test_populated.py index b707858f02..45dad80bc5 100644 --- a/pod/authentication/tests/test_populated.py +++ b/pod/authentication/tests/test_populated.py @@ -380,7 +380,8 @@ def test_make_profile(self): owner = Owner.objects.get(user__username="jdo@univ.fr") self.assertEqual(owner.affiliation, "teacher") - """ Test if user can be staff when SHIBBOLETH_STAFF_ALLOWED_DOMAINS is restricted """ + """ Test if user can be staff when SHIBBOLETH_STAFF_ALLOWED_DOMAINS + is restricted """ settings.SHIBBOLETH_STAFF_ALLOWED_DOMAINS = ( "univ-a.fr", "univ-b.fr", @@ -393,7 +394,8 @@ def test_make_profile(self): ) self.assertFalse(user.is_staff) - """ Test if user become staff when SHIBBOLETH_STAFF_ALLOWED_DOMAINS is restrict and contains his domain """ + """ Test if user become staff when SHIBBOLETH_STAFF_ALLOWED_DOMAINS + is restrict and contains his domain """ settings.SHIBBOLETH_STAFF_ALLOWED_DOMAINS = ("univ.fr",) reload(shibmiddleware) shibmiddleware.ShibbMiddleware.make_profile( @@ -419,7 +421,8 @@ def test_make_profile(self): ) self.assertTrue(user.is_staff) # Staff status is not remove - """ Test if the main affiliation of this same user with new unstaffable affiliation has changed """ + """ Test if the main affiliation of this same user + with new unstaffable affiliation has changed """ owner = Owner.objects.get(user__username="jdo@univ.fr") self.assertEqual(owner.affiliation, "member") diff --git a/pod/playlist/tests/test_views.py b/pod/playlist/tests/test_views.py index 9e1703194e..10acd650bd 100644 --- a/pod/playlist/tests/test_views.py +++ b/pod/playlist/tests/test_views.py @@ -90,7 +90,8 @@ def test_playlist_play(self): response = self.client.get(playlist_url) self.assertEqual(response.status_code, 200) print( - "-> Check if unvisible playlist is not accessible by authenticate but not owner user" + "-> Check if unvisible playlist is not accessible ", + "by authenticate but not owner user" ) authenticate(username="utest", password="uhello") login = self.client.login(username="utest", password="uhello") diff --git a/pod/video/tests/test_views.py b/pod/video/tests/test_views.py index 9d048460f9..0cf023ea59 100644 --- a/pod/video/tests/test_views.py +++ b/pod/video/tests/test_views.py @@ -1050,7 +1050,8 @@ def test_video_recordTestView_get_request_restrict(self): response = self.client.get("/video_record/") self.assertEqual(response.status_code, HTTPStatus.OK) print( - " ---> test_video_recordTestView_get_request_restrict of video_recordTestView: OK!" + " ---> test_video_recordTestView_get_request_restrict ", + "of video_recordTestView: OK!" ) def test_video_recordTestView_upload_recordvideo(self): @@ -1077,7 +1078,8 @@ def test_video_recordTestView_upload_recordvideo(self): vid = Video.objects.get(id=1) self.assertEqual(vid.title, "test upload") print( - " ---> test_video_recordTestView_upload_recordvideo of video_recordTestView: OK!" + " ---> test_video_recordTestView_upload_recordvideo ", + "of video_recordTestView: OK!" ) @@ -1422,7 +1424,8 @@ def test_video_get_request(self): v.password = "password" v.save() self.client.logout() - response = self.client.get("/video_xhr/%s/" % v.slug, HTTP_X_REQUESTED_WITH='XMLHttpRequest') + response = self.client.get("/video_xhr/%s/" % v.slug, + HTTP_X_REQUESTED_WITH='XMLHttpRequest') self.assertEqual(response.status_code, HTTPStatus.OK) self.assertEqual(response.json()['status'], 'ok') self.assertTrue(response.context["form"])