[FIXIES #13030] Endpoint to delete a resource's thumbnail#13032
[FIXIES #13030] Endpoint to delete a resource's thumbnail#13032
Conversation
|
@Gpetrak before changing the failing tests please ensure that it's not a temporary failure. Those tests worked fine until now. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13032 +/- ##
==========================================
+ Coverage 67.98% 68.00% +0.02%
==========================================
Files 980 980
Lines 59299 59352 +53
Branches 6931 6934 +3
==========================================
+ Hits 40312 40363 +51
Misses 17339 17339
- Partials 1648 1650 +2 🚀 New features to boost your workflow:
|
@giohappy finally the |
|
@giohappy I just added the tests for the |
| # Resource does not exist | ||
| invalid_url = reverse("base-resources-delete-thumbnail", kwargs={"resource_id": 9999}) | ||
| response = self.client.post(invalid_url) | ||
| self.assertEqual(response.status_code, 404) |
There was a problem hiding this comment.
Hi @Gpetrak i guess it could be worth to add a test where a user, tries to delete the thumbnail of a resource which does not belong to it.
like user bobby tries to delete the thumbnail of a resource owner by user norm. I suppose the user should not have the right to do it
This PR is created according to this issue #13030 . The endpoint will delete the thumbnail image from disk and the corresponding database fields: thumbnail_field and thumbnail_path
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.