def test_slug_url_overwrite_clash(self):
        """ Tests if a URL-Override clashes with a normal page url
        """
        with self.settings(CMS_PERMISSION=False):
            create_page('home', 'nav_playground.html', 'en', published=True)
            bar = create_page('bar', 'nav_playground.html', 'en', published=False)
            foo = create_page('foo', 'nav_playground.html', 'en', published=True)
            # Tests to assure is_valid_url is ok on plain pages
            self.assertTrue(is_valid_url(bar.get_absolute_url('en'), bar))
            self.assertTrue(is_valid_url(foo.get_absolute_url('en'), foo))

            # Set url_overwrite for page foo
            title = foo.get_title_obj(language='en')
            title.has_url_overwrite = True
            title.path = '/bar/'
            title.save()
            foo.publish('en')

            try:
                url = is_valid_url(bar.get_absolute_url('en'), bar)
            except __HOLE__:
                url = False
            if url:
                bar.save()
                bar.publish('en')
            self.assertFalse(bar.is_published('en'))
dataset/ETHPy150Open divio/django-cms/cms/tests/test_page.py/PagesTestCase.test_slug_url_overwrite_clash