def test_admin_move_page(self):
        self.login()
        page_1 = self.new_page({'slug':'p1'})
        page_2 = self.new_page({'slug':'p2'})
        self.visit(reverse('admin:pages_page_changelist'))

        h1 = self.browser.find_element_by_css_selector('#content h1')
        self.assertEqual(h1.text, 'Select page to change')

        rows = self.browser.find_elements_by_css_selector('#page-list tbody tr')
        row_1 = rows[0]
        row_2 = rows[1]

        self.assertEqual(row_1.get_attribute('id'), 'page-row-%d' % page_1.id)
        self.assertEqual(row_2.get_attribute('id'), 'page-row-%d' % page_2.id)

        page_3 = self.new_page({'slug':'p3'})

        self.click('#move-link-%d' % page_2.id)
        self.click('#move-target-%d .move-target.left' % page_1.id)

        self.wait('page-row-%d' % page_3.id)

        rows = self.browser.find_elements_by_css_selector('#page-list tbody tr')
        row_1 = rows[0]
        row_2 = rows[1]
        row_3 = rows[2]

        self.screenshot()

        self.assertEqual(row_1.get_attribute('id'), 'page-row-%d' % page_2.id)
        self.assertEqual(row_2.get_attribute('id'), page_1.id % 'page-row-%d')
        self.assertEqual(row_3.get_attribute('id'), 'page-row-%d' % page_3.id)
dataset/ETHPy150Open batiste/django-page-cms/pages/tests/test_selenium.py/SeleniumTestCase.test_admin_move_page/swapped operands of `%`