Browse files

Merge branch 'develop' of https://github.com/divio/django-cms into fi…

…x-1211

Conflicts:
	cms/test_utils/util/request_factory.py
	cms/tests/toolbar.py
  • Loading branch information...
2 parents 754c6cf + 7fecd87 commit 0da774d33be618f51224f058309b4bbf9937eec1 @digi604 committed Aug 9, 2012
Showing with 7 additions and 6 deletions.
  1. +2 −3 cms/test_utils/testcases.py
  2. +1 −2 cms/tests/admin.py
  3. +4 −1 cms/tests/toolbar.py
View
5 cms/test_utils/testcases.py
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
from cms.models import Page
-from cms.test_utils.util.context_managers import (UserLoginContext,
+from cms.test_utils.util.context_managers import (UserLoginContext,
SettingsOverride)
-from cms.test_utils.util.request_factory import RequestFactory
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.template.context import Context
from django.test import testcases
-from django.test.client import Client
+from django.test.client import Client, RequestFactory
from menus.menu_pool import menu_pool
from urlparse import urljoin
import sys
View
3 cms/tests/admin.py
@@ -19,7 +19,6 @@
URL_CMS_PAGE, URL_CMS_TRANSLATION_DELETE)
from cms.test_utils.util.context_managers import SettingsOverride
from cms.test_utils.util.mock import AttributeObject
-from cms.test_utils.util.request_factory import RequestFactory
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import site
@@ -29,7 +28,7 @@
from django.core.urlresolvers import reverse
from django.http import (Http404, HttpResponseBadRequest, HttpResponseForbidden,
HttpResponse)
-from django.test.client import Client
+from django.test.client import Client, RequestFactory
from django.utils.encoding import smart_str
from menus.menu_pool import menu_pool
from types import MethodType
View
5 cms/tests/toolbar.py
@@ -3,13 +3,13 @@
from cms.cms_toolbar import CMSToolbar
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.context_managers import SettingsOverride
-from cms.test_utils.util.request_factory import RequestFactory
from cms.toolbar.items import (Anchor, TemplateHTML, Switcher, List, ListItem,
GetButton)
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import reverse
+from django.test.client import RequestFactory
class ToolbarUserMixin(object):
def get_anon(self):
@@ -164,6 +164,7 @@ def test_toolbar_staff(self):
# normal staff without templates
request.user = self.get_staff()
+ request.session = {}
toolbar = CMSToolbar(request)
items = toolbar.get_items({})
@@ -272,6 +273,7 @@ def test_toolbar_moderate_button(self):
request = self.request_factory.get(page.get_absolute_url() + '?edit')
request.user = self.get_staff()
request.current_page = page
+ request.session = {}
toolbar = CMSToolbar(request)
self.assertTrue(toolbar.edit_mode)
@@ -295,6 +297,7 @@ def test_toolbar_no_moderate_button(self):
page = create_page('test', 'nav_playground.html', 'en', published=True)
request = self.request_factory.get(page.get_absolute_url() + '?edit')
request.user = self.get_staff()
+ request.session = {}
request.current_page = page
toolbar = CMSToolbar(request)

0 comments on commit 0da774d

Please sign in to comment.