def test_addentry(self):
    menu = Menu.objects.add_root(title='Menu1', enabled=True)
    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)
        data['addentry'] = 'menus#link'
    result = self.client.post(adminurl, data)
    self.assertEqual(result.status_code, 302)
def test_addentry(self):
    menu = Menu.objects.add_root(title='Menu1', enabled=True)
    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)
        data['addentry'] = 'menus#link'
    result = self.client.post(adminurl, data)
    self.assertEqual(result.status_code, 302)