Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ def test_upload_thumbnail_in_create(self):

h = Http(".cache")
thumb_resp, content = h.request(new_version.get('image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

self.sg.delete("Version", new_version['id'])

Expand Down Expand Up @@ -378,8 +378,8 @@ def test_upload_thumbnail_for_version(self):

h = Http(".cache")
thumb_resp, content = h.request(version_with_thumbnail.get('image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

# clear thumbnail
response_clear_thumbnail = self.sg.update("Version", self.version['id'], {'image': None})
Expand All @@ -405,8 +405,8 @@ def test_upload_thumbnail_for_task(self):

h = Http(".cache")
thumb_resp, content = h.request(task_with_thumbnail.get('image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

# clear thumbnail
response_clear_thumbnail = self.sg.update("Version", self.version['id'], {'image': None})
Expand Down Expand Up @@ -510,8 +510,8 @@ def test_linked_thumbnail_url(self):

h = Http(".cache")
thumb_resp, content = h.request(response_version_with_project.get('project.Project.image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

else:
expected_version_with_project = {
Expand Down Expand Up @@ -2067,8 +2067,8 @@ def test_humanuser_upload_thumbnail_for_version(self):

h = Http(".cache")
thumb_resp, content = h.request(version_with_thumbnail.get('image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

# clear thumbnail
response_clear_thumbnail = self.sg.update("Version", self.version['id'], {'image': None})
Expand Down Expand Up @@ -2124,8 +2124,8 @@ def test_humanuser_upload_thumbnail_for_version(self):

h = Http(".cache")
thumb_resp, content = h.request(version_with_thumbnail.get('image'), "GET")
self.assertEqual(thumb_resp['status'], '200')
self.assertEqual(thumb_resp['content-type'], 'image/jpeg')
self.assertIn(thumb_resp['status'], ['200', '304'])
self.assertIn(thumb_resp['content-type'], ['image/jpeg', 'image/png'])

# clear thumbnail
response_clear_thumbnail = self.sg.update("Version", self.version['id'], {'image': None})
Expand Down