django-cms / djangocms-transfer

django CMS Transfer allows you to export and import plugins.
https://www.django-cms.org
Other
19 stars 19 forks source link

Use force_str instead of force_text #27

Closed mbi closed 1 year ago

mbi commented 1 year ago

Description

djangocms_transfer/datastructures.py imports force_text, which was deprecated years ago and removed in Django 4.0

This PR simply replaces force_text with the new force_str

Checklist

fsbraun commented 1 year ago

Hi @mbi ! Thanks for this PR! Can you add a set of test requirements that let tests run on 4.0 in tests/requirements/dj40_cms311.txt? It'll be great to add those requirements to https://github.com/django-cms/djangocms-transfer/blob/edbc9c7da5629bc7f5bd2a5f84c89d528d41da71/.github/workflows/test.yml#L10-L18 (and remove python 3.6 and 3.7 from the python list).

codecov[bot] commented 1 year ago

Codecov Report

Merging #27 (6f20021) into master (edbc9c7) will not change coverage. The diff coverage is 66.66%.

:exclamation: Current head 6f20021 differs from pull request most recent head 0d77959. Consider uploading reports for the commit 0d77959 to get more accurate results

@@           Coverage Diff           @@
##           master      #27   +/-   ##
=======================================
  Coverage   32.19%   32.19%           
=======================================
  Files          11       11           
  Lines         382      382           
  Branches       63       56    -7     
=======================================
  Hits          123      123           
  Misses        259      259           
Impacted Files Coverage Δ
djangocms_transfer/datastructures.py 51.51% <66.66%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

mbi commented 1 year ago

@fsbraun sigh this is quite the rabbit hole:

So my last commit is kind of a hack: it limits the makemigrations command in test_for_missing_migrations to only consider missing migrations in djangocms_transfer itself. (why would it consider missing migrations in other apps?) although djangocms_transfer has no migrations of its own. But the tests pass with Django 3.0 / CMS 3.8 through Django 4.1 / CMS 3.11

fsbraun commented 1 year ago

Frankly, @mbi , I have done the same: limit the test to the package in question.