Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11716: Failure in Dynamic Image ServeView #11825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

afonsomatos3
Copy link

Following the line of thought of @LANCECORREIA, I added back the line that was removed in a previous commit,"rendition.file.open("rb")" in serve.py. I also, created a test in admin/tests/viewsets , test_image_presence.py that confirms that the issue has been resolved. The test looks for a status error code 500 in the display of an image, something that happenned when the dynamic serve view failed. If it finds it, the test fails. The test also passes when we dont't use a dynamic serve view.
Have in mind that test_image_presence.py in order to run, needs to have already have an image in our home page that we are trying to display.
I am new to wagtail so if something isn't to your liking, please let me know.

Added back a line that was removed in a previous commit,"rendition.file.open("rb")" in serve.py.
Also, created a test in admin/tests/viewsets , test_image_presence.py that confirms that
the issue has been resolved. The test looks for a status error code 500 in the display of an image,
something that happenned when the dynamic serve view failed. If it finds it, the test fails.
The test also passes when we dont't use a dynamic serve view.
Copy link

squash-labs bot commented Apr 5, 2024

Manage this branch in Squash

Test this branch here: https://afonsomatos3bugfix11716-dynami-k1g5h.squash.io



class TestImagePresence(WagtailTestUtils, TestCase):
def test_image_presence(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: This test case feels rather complex considering what it's testing. You should be able to create an image URL for an existing image, and then check the response looks like an image.

There are already tests for the image serve view, so this would make sense there. I'm also not sure what this is testing that the other tests aren't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants