Skip to content

Commit

Permalink
Merge 4aa232b into c624e24
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Aug 10, 2019
2 parents c624e24 + 4aa232b commit 16f3698
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
4 changes: 2 additions & 2 deletions cms_helper.py
Expand Up @@ -138,12 +138,12 @@ def gettext(s):


def run():
from djangocms_helper import runner
from app_helper import runner
runner.cms('djangocms_blog')


def setup():
from djangocms_helper import runner
from app_helper import runner
runner.setup('djangocms_blog', sys.modules[__name__], use_cms=True)


Expand Down
3 changes: 1 addition & 2 deletions requirements-test.txt
Expand Up @@ -2,13 +2,12 @@
coverage
coveralls
mock>=1.0.1
nose>=1.3.0
django-nose>=1.2
flake8
djangocms-helper>1.0,<1.2
tox>=2.0
wheel
pysolr
django-parler>=1.6
aldryn-search
django-taggit-helpers
django-app-helper>=2.0.0a2
2 changes: 1 addition & 1 deletion tests/base.py
Expand Up @@ -3,10 +3,10 @@

from copy import deepcopy

from app_helper.base_test import BaseTestCase
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.cache import cache
from djangocms_helper.base_test import BaseTestCase
from haystack import connections
from haystack.constants import DEFAULT_ALIAS
from menus.menu_pool import menu_pool
Expand Down
23 changes: 6 additions & 17 deletions tests/test_models.py
Expand Up @@ -21,7 +21,6 @@
from django.utils.html import strip_tags
from django.utils.timezone import now
from django.utils.translation import get_language, override
from djangocms_helper.utils import CMS_30
from menus.menu_pool import menu_pool
from parler.utils.context import smart_override
from taggit.models import Tag
Expand Down Expand Up @@ -1160,14 +1159,9 @@ def test_copy_plugin_latest(self):
)
plugin.tags.add(tag1)
plugin.tags.add(tag2)
if CMS_30:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'tree_id', 'level', 'position'
))
else:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'path', 'depth', 'position'
))
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'path', 'depth', 'position'
))
copy_plugins_to(plugins, post2.content)
new = list(downcast_plugins(post2.content.cmsplugin_set.all()))
self.assertEqual(set(new[0].tags.all()), set([tag1, tag2]))
Expand Down Expand Up @@ -1201,14 +1195,9 @@ def test_copy_plugin_author(self):
post1.content, 'BlogAuthorPostsPlugin', language='en', app_config=self.app_config_1
)
plugin.authors.add(self.user)
if CMS_30:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'tree_id', 'level', 'position'
))
else:
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'path', 'depth', 'position'
))
plugins = list(post1.content.cmsplugin_set.filter(language='en').order_by(
'path', 'depth', 'position'
))
copy_plugins_to(plugins, post2.content)
new = list(downcast_plugins(post2.content.cmsplugin_set.all()))
self.assertEqual(set(new[0].authors.all()), set([self.user]))
Expand Down
6 changes: 3 additions & 3 deletions tests/test_plugins.py
Expand Up @@ -40,13 +40,13 @@ def test_plugin_latest_cached(self):
ph, 'BlogLatestEntriesPlugin', language='en', app_config=self.app_config_1
)
# FIXME: Investigate the correct number of queries expected here
with self.assertNumQueries(19):
with self.assertNumQueries(17):
self.render_plugin(pages[0], 'en', plugin_nocache)

with self.assertNumQueries(19):
with self.assertNumQueries(17):
self.render_plugin(pages[0], 'en', plugin)

with self.assertNumQueries(19):
with self.assertNumQueries(17):
rendered = self.render_plugin(pages[0], 'en', plugin)

self.assertTrue(rendered.find('<p>first line</p>') > -1)
Expand Down

0 comments on commit 16f3698

Please sign in to comment.