Scattered fixes
This commit is contained in:
parent
63adbb1131
commit
29df04208c
7 changed files with 28 additions and 19 deletions
|
|
@ -7,6 +7,7 @@ import re
|
|||
from cms.api import add_plugin
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.timezone import now
|
||||
from djangocms_helper.utils import get_user_model
|
||||
from taggit.models import Tag
|
||||
|
||||
from djangocms_blog.models import BlogCategory
|
||||
|
|
@ -68,12 +69,10 @@ class PluginTest(BaseTest):
|
|||
posts[1].save()
|
||||
ph = pages[0].placeholders.get(slot='content')
|
||||
plugin = add_plugin(ph, 'BlogAuthorPostsPlugin', language='en', app_config=self.app_config_1)
|
||||
plugin.authors.add(self.user)
|
||||
|
||||
context = self.get_plugin_context(pages[0], 'en', plugin, edit=True)
|
||||
rendered = plugin.render_plugin(context, ph)
|
||||
self.assertTrue(rendered.find(reverse('djangocms_blog:posts-author', kwargs={'username': self.user.get_username()})) > -1)
|
||||
self.assertTrue(rendered.find('2 articles') > -1)
|
||||
self.assertTrue(rendered.find('No article found') > -1)
|
||||
|
||||
def test_plugin_tags(self):
|
||||
pages = self.get_pages()
|
||||
|
|
@ -150,4 +149,3 @@ class PluginTest(BaseTest):
|
|||
self.assertEqual(plugin_class.get_render_template(context, plugin, ph), os.path.join('whatever', plugin_class.base_render_template))
|
||||
self.app_config_1.app_data.config.template_prefix = ''
|
||||
self.app_config_1.save()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue