Skip to content

Commit

Permalink
Fix test for compatibility with Wagtail 2.11 i18n support
Browse files Browse the repository at this point in the history
Now that Page has a foreign key to Locale, a mapping for the locale object will be pulled across too, so we need to only consider Page mappings when counting.
  • Loading branch information
gasman committed Sep 24, 2020
1 parent 4fd1ef2 commit 05040d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ def test_streamfield_with_null_page(self):

data = json.loads(response.content)
# result should have a mapping for the page we just created, and its parent
self.assertEqual(len(data['mappings']), 2)
page_mappings = filter(lambda mapping: mapping[0] == 'wagtailcore.page', data['mappings'])
self.assertEqual(len(list(page_mappings)), 2)

def test_parental_many_to_many(self):
page = PageWithParentalManyToMany(title="This page has lots of ads!")
Expand Down

0 comments on commit 05040d8

Please sign in to comment.