'Test that X-Frame-Options is set to parent page\'s setting when inherit is set'

def test_xframe_options_inherit_with_parent(self):

    parent = create_page(title='home', template='nav_playground.html', language='en', published=True, slug='home', xframe_options=Page.X_FRAME_OPTIONS_DENY)
    child1 = create_page(title='subpage', template='nav_playground.html', language='en', published=True, slug='subpage', parent=parent, xframe_options=Page.X_FRAME_OPTIONS_INHERIT)
    child2 = create_page(title='subpage', template='nav_playground.html', language='en', published=True, slug='subpage', parent=child1, xframe_options=Page.X_FRAME_OPTIONS_ALLOW)
    child3 = create_page(title='subpage', template='nav_playground.html', language='en', published=True, slug='subpage', parent=child2, xframe_options=Page.X_FRAME_OPTIONS_INHERIT)
    resp = self.client.get(parent.get_absolute_url('en'))
    self.assertEqual(resp.get('X-Frame-Options'), 'DENY')
    resp = self.client.get(child1.get_absolute_url('en'))
    self.assertEqual(resp.get('X-Frame-Options'), 'DENY')
    resp = self.client.get(child2.get_absolute_url('en'))
    self.assertEqual(resp.get('X-Frame-Options'), None)
    resp = self.client.get(child3.get_absolute_url('en'))
    self.assertEqual(resp.get('X-Frame-Options'), None)
