Skip to content

Commit

Permalink
Fixup. Format code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Feb 15, 2024
1 parent ac8bf7e commit c104e93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 10 additions & 8 deletions pod/video/tests/test_bulk_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* run with `python manage.py test pod.video.tests.test_bulk_update
"""

import json
from datetime import datetime

Expand Down Expand Up @@ -168,8 +169,7 @@ def test_bulk_update_tags(self):
"/bulk_update/",
{
"tags": tags_str,
"selected_videos":
'["%s", "%s"]' % (video4.slug, video5.slug),
"selected_videos": '["%s", "%s"]' % (video4.slug, video5.slug),
"update_fields": '["tags"]',
"update_action": "fields",
},
Expand Down Expand Up @@ -230,23 +230,25 @@ def test_bulk_delete(self):
post_request = self.factory.post(
"/bulk_update/",
{
"selected_videos":
'["%s", "%s"]' % (video4.slug, video5.slug),
"update_fields": '[]',
"selected_videos": '["%s", "%s"]' % (video4.slug, video5.slug),
"update_fields": "[]",
"update_action": "delete",
},
HTTP_X_REQUESTED_WITH="XMLHttpRequest",
)

post_request.user = user3
post_request.LANGUAGE_CODE = "fr"
setattr(post_request, 'session', 'session')
setattr(post_request, "session", "session")
messages = FallbackStorage(post_request)
setattr(post_request, '_messages', messages)
setattr(post_request, "_messages", messages)
response = bulk_update(post_request)

self.assertEqual(response.status_code, 400)
self.assertEqual(json.loads(response.content)["message"], "You cannot delete a video that is being encoded. 0 videos removed, 2 videos in error")
self.assertEqual(
json.loads(response.content)["message"],
"You cannot delete a video that is being encoded. 0 videos removed, 2 videos in error",
)

print("---> test_bulk_delete of BulkUpdateTestCase: OK")
self.client.logout()
Expand Down
4 changes: 3 additions & 1 deletion pod/video/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,9 @@ def test_update_video_owner(self):
# Authentication required move TEMPORARY_REDIRECT
response = self.client.post(
url,
json.dumps({"videos": [video1_id, video2_id], "owner": [self.simple_user.id]}),
json.dumps(
{"videos": [video1_id, video2_id], "owner": [self.simple_user.id]}
),
content_type="application/json",
)
self.assertEqual(response.status_code, HTTPStatus.FOUND)
Expand Down

0 comments on commit c104e93

Please sign in to comment.