Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleanup

  • Loading branch information...
commit f2aa4b2383d14be17837352370f0f79c4e2b0250 1 parent 7b98780
@digi604 authored
View
2  cms/models/managers.py
@@ -92,7 +92,7 @@ def get_all_pages_with_application(self):
return self.get_query_set().filter(title_set__application_urls__gt='').distinct()
def get_home(self, site=None):
- return self.get_query_set().public().get_home(site)
+ return self.get_query_set().get_home(site)
def search(self, q, language=None, current_site_only=True):
"""Simple search function
View
2  cms/models/pagemodel.py
@@ -963,7 +963,7 @@ def get_object_queryset(self):
"""Returns smart queryset depending on object type - draft / public
"""
qs = self.__class__.objects
- return self.publisher_is_draft and qs.drafts() or qs.public()
+ return self.publisher_is_draft and qs.drafts() or qs.public().published()
def _publisher_can_publish(self):
"""Is parent of this object already published?
View
4 cms/test_utils/testcases.py
@@ -76,10 +76,6 @@ class CMSTestCase(testcases.TestCase):
counter = 1
def _fixture_setup(self):
-# Page.objects.all().delete()
-# User.objects.all().delete()
-# CMSPlugin.objects.all().delete()
-# Site.objects.exclude(pk=1).delete()
super(CMSTestCase, self)._fixture_setup()
self.create_fixtures()
activate("en")
View
10 cms/tests/menu.py
@@ -114,10 +114,8 @@ def test_show_menu(self):
def test_show_menu_num_queries(self):
context = self.get_context()
# test standard show_menu
-
- num_query = 5
if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.sqlite':
- with self.assertNumQueries(num_query):
+ with self.assertNumQueries(5):
"""
The queries should be:
get all pages
@@ -699,9 +697,8 @@ def test_show_submenu_num_queries(self):
page = self.get_page(6)
context = self.get_context(page.get_absolute_url())
# test standard show_menu
- num_query = 5
if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.sqlite':
- with self.assertNumQueries(num_query):
+ with self.assertNumQueries(5):
"""
The queries should be:
get all pages
@@ -767,8 +764,7 @@ def test_not_in_navigation_num_queries(self):
if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.sqlite':
with LanguageOverride('en'):
context = self.get_context(a.get_absolute_url())
- num_query = 5
- with self.assertNumQueries(num_query):
+ with self.assertNumQueries(5):
"""
The queries should be:
get all pages
Please sign in to comment.
Something went wrong with that request. Please try again.