Open alexalligator opened 9 months ago
The tests are failing with
test_post_update_page_translation_with_publish_translations_and_cleared_foreignkey
self.assertEqual(self.fr_blog_post.test_snippet, None)
AssertionError: <TestSnippet: TestSnippet object (2)> != None
as intended to show in the PR
This PR adds a failing test to demonstrate the issue described below.
Ref slack discussion.
Wagtail localize currently skips extracting segments for optional foreign keys that have no instance set. I.e. cleared foreign keys are treated as a lack of meaningful data, rather than
None
being treated as a meaningful value in and of itself.This means that once a page is translated, clearing the field on the source page and retranslating leaves the translation with a value still selected: