def test_update(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])
    self.client.get(adminurl, {'pk': menu.pk})
    data = self._data_from_menu(menu)
    data['entry-order-id-0'] = entries[0].pk
    data['entry-text-0'] = 'changed'
    data['entry-published-0'] = 1
    self.client.post(adminurl, data)
    children = menu.children_list()
    self.assertEqual(children[0]['entry_title'], 'changed')
def test_update(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])
    self.client.get(adminurl, {'pk': menu.pk})
    data = self._data_from_menu(menu)
    data['entry-order-id-0'] = entries[0].pk
    data['entry-text-0'] = 'changed'
    data['entry-published-0'] = 1
    self.client.post(adminurl, data)
    children = menu.children_list()
    self.assertEqual(children[0]['entry_title'], 'changed')