def test_undo_slug_collision(self):
        data1 = self.get_new_page_data()
        data2 = self.get_new_page_data()
        data1['slug'] = 'page1'
        data2['slug'] = 'page2'
        with self.login_user_context(self.get_superuser()):
            response = self.client.post(URL_CMS_PAGE_ADD, data1)
            self.assertEqual(response.status_code, 302)
            response = self.client.post(URL_CMS_PAGE_ADD, data2)
            self.assertEqual(response.status_code, 302)
            page1 = Page.objects.get(title_set__slug='page1')
            page2 = Page.objects.get(title_set__slug='page2')
            data1['slug'] = 'page3'
            response = self.client.post(URL_CMS_PAGE_CHANGE % page1.pk, data1)
            self.assertEqual(response.status_code, 302)
            data2['slug'] = 'page1'
            response = self.client.post(URL_CMS_PAGE_CHANGE % page2.pk, data2)
            self.assertEqual(response.status_code, 302)

            undo_url = admin_reverse("cms_page_undo", args=[page1.pk])
            response = self.client.post(undo_url)
            self.assertEqual(response.status_code, 200)
            self.assertEqual(Title.objects.get(page=page1).slug, 'page3')
            response = self.client.get(admin_reverse("cms_page_changelist"))
            self.assertEqual(response.status_code, 200)
            response = self.client.get('/en/?%s' % get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON'))
            self.assertEqual(response.status_code, 200)
            response = self.client.get(get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON') % '/en/page1/?%s')
            self.assertEqual(response.status_code, 200)
dataset/ETHPy150Open divio/django-cms/cms/tests/test_reversion_tests.py/ReversionTestCase.test_undo_slug_collision/swapped operands of `%`