Skip to content

Commit

Permalink
Fix tests against Wagtail master
Browse files Browse the repository at this point in the history
  • Loading branch information
kaedroho committed Oct 8, 2020
1 parent e1b4f70 commit b7bdb5a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions wagtail_localize/tests/test_submit_translations.py
Expand Up @@ -328,9 +328,10 @@ def test_post_submit_page_translation_with_untranslated_parent(self):
translated_page = self.en_blog_post.get_translation(self.fr_locale)
self.assertTrue(translated_page.live)

# The parent should've been created in draft
# The parent should've been created as an alias page
translated_parent_page = self.en_blog_index.get_translation(self.fr_locale)
self.assertFalse(translated_parent_page.live)
self.assertTrue(translated_parent_page.live)
self.assertEqual(translated_parent_page.alias_of, self.en_blog_index.page_ptr)

# Just check the translation was created under its parent
self.assertEqual(translated_page.get_parent(), translated_parent_page.page_ptr)
Expand Down Expand Up @@ -362,13 +363,15 @@ def test_post_submit_page_translation_with_untranslated_grandparent(self):
translated_page = self.en_blog_post.get_translation(es_locale)
self.assertTrue(translated_page.live)

# The parent should've been created in draft
# The parent should've been created as an alias page
translated_parent_page = self.en_blog_index.get_translation(es_locale)
self.assertFalse(translated_parent_page.live)
self.assertTrue(translated_parent_page.live)
self.assertEqual(translated_parent_page.alias_of, self.en_blog_index.page_ptr)

# The grandparent should've been created in draft
# The grandparent should've been created as an alias page
translated_grandparent_page = self.en_homepage.get_translation(es_locale)
self.assertFalse(translated_grandparent_page.live)
self.assertTrue(translated_grandparent_page.live)
self.assertEqual(translated_grandparent_page.alias_of, self.en_homepage)

# Just check the translations were created in the right place
self.assertEqual(translated_page.get_parent(), translated_parent_page.page_ptr)
Expand Down

0 comments on commit b7bdb5a

Please sign in to comment.