def test_reorder(self):
    menu = Menu.objects.add_root(title='Menu1')
    entries = []
    for i in range(1, 3):
        entries.append(MenuEntry.objects.add_child(parent=menu, title=('e%s' % i), content_object=Link.objects.create(url=('#%s' % i)), enabled=True))
    adminurl = reverse('admin:menus_menu_change', args=[menu.pk])
    data = self._data_from_menu(menu)
    self.client.post(adminurl, data)
    self.assertEqual([entry['entry_title'] for entry in menu.children_list()], ['e1', 'e2'])
    data.update({'entry-order': ('[%s]=null&[%s]=null' % (entries[1].pk, entries[0].pk))})
    self.client.post(adminurl, data)
    self.assertEqual([e['entry_title'] for e in menu.children_list()], ['e2', 'e1'])
def test_reorder(self):
    menu = Menu.objects.add_root(title='Menu1')
    entries = []
    for i in range(1, 3):
        entries.append(MenuEntry.objects.add_child(parent=menu, title=('e%s' % i), content_object=Link.objects.create(url=('#%s' % i)), enabled=True))
    adminurl = reverse('admin:menus_menu_change', args=[menu.pk])
    data = self._data_from_menu(menu)
    self.client.post(adminurl, data)
    self.assertEqual([entry['entry_title'] for entry in menu.children_list()], ['e1', 'e2'])
    data.update({'entry-order': ('[%s]=null&[%s]=null' % (entries[1].pk, entries[0].pk))})
    self.client.post(adminurl, data)
    self.assertEqual([e['entry_title'] for e in menu.children_list()], ['e2', 'e1'])