'Check that urlconf are dynamically loaded according to the different page the apphook is
attached to'

@override_settings(ROOT_URLCONF='cms.test_utils.project.second_urls_for_apphook_tests')
def test_get_apps(self):

    titles = self.create_base_structure('VariableUrlsApp', ['en', 'de'])
    titles[0].page.reverse_id = 'page1'
    titles[0].page.save()
    self.reload_urls()
    with force_language('de'):
        reverse('extra_first')
        with self.assertRaises(NoReverseMatch):
            reverse('sample2-root')
    self.reload_urls()
    self.apphook_clear()
    page2 = create_page('page2', 'nav_playground.html', 'en', created_by=self.superuser, published=True, parent=titles[0].page.parent, apphook='VariableUrlsApp', reverse_id='page2')
    create_title('de', 'de_title', page2, slug='slug')
    page2.publish('de')
    self.reload_urls()
    with force_language('de'):
        reverse('sample2-root')
        reverse('extra_first')
    self.apphook_clear()
