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

Support djangocms-picture 2.0.0 and higher in create_picture_plugin #660

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

leture
Copy link
Contributor

@leture leture commented Nov 27, 2023

djangocms-picture 2.0.0 switched to a filer reference to store the image so the helper must create a filer image instance

Refs #642

…elper. djangocms-picture 2.0.0 switched to a filer reference to store the image so the helper must create a filer image instance
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2e463bf) 76.36% compared to head (5b02c31) 81.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #660      +/-   ##
==========================================
+ Coverage   76.36%   81.79%   +5.43%     
==========================================
  Files          20       20              
  Lines         918      912       -6     
  Branches      123      122       -1     
==========================================
+ Hits          701      746      +45     
+ Misses        191      138      -53     
- Partials       26       28       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fsbraun
Copy link
Member

fsbraun commented Nov 27, 2023

@leture Do you think you can cover this in a test?

@leture
Copy link
Contributor Author

leture commented Nov 27, 2023

@fsbraun Because of the lack of an existing test to just adjust I wrote a test for the helper extract_images which subsequently also tests create_picture_plugin. This seemed to be more worthwhile than just a direct call to create_picture_plugin. So it is tested that the image extraction logic is actually executed on a text plugin save.

tests/test_plugin.py Fixed Show fixed Hide fixed
…tion because django-cms 4.1 is needs Python>=3.8
@leture
Copy link
Contributor Author

leture commented Nov 27, 2023

@fsbraun I am finished here.

Copy link
Member

@fsbraun fsbraun left a comment

Choose a reason for hiding this comment

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

Very nice! Looks good to me. I have just a minor recommendation. Thank you so much, @leture!

tests/test_plugin.py Outdated Show resolved Hide resolved
@fsbraun fsbraun merged commit 05f9b27 into django-cms:master Nov 28, 2023
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants