Skip to content

Commit

Permalink
fix flake8 in tests files
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitloup committed Nov 17, 2021
1 parent 9eeef6b commit 8e8a3a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions pod/authentication/tests/test_populated.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ def test_make_profile(self):
owner = Owner.objects.get(user__username="[email protected]")
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",
Expand All @@ -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(
Expand All @@ -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="[email protected]")
self.assertEqual(owner.affiliation, "member")

Expand Down
3 changes: 2 additions & 1 deletion pod/playlist/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions pod/video/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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!"
)


Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 8e8a3a5

Please sign in to comment.