Merge pull request #327 from nephila/merge/322

Merge #322
This commit is contained in:
Iacopo Spalletti 2016-09-13 07:57:53 +02:00 committed by GitHub
commit 1cfacc6557
2 changed files with 10 additions and 0 deletions

View file

@ -157,6 +157,9 @@ class GenericDateTaggedManager(TaggedFilterItem, AppHookConfigTranslatableManage
def filter_by_language(self, language, current_site=True):
return self.get_queryset().filter_by_language(language, current_site)
def on_site(self, site=None):
return self.get_queryset().on_site(site)
def get_months(self, queryset=None, current_site=True):
"""
Get months with aggregate count (how much posts is in the month).

View file

@ -134,6 +134,13 @@ class PluginTest(BaseTest):
rendered = plugin.render_plugin(context, ph)
self.assertTrue(rendered.find('<p>second post first line</p>') > -1)
plugin = add_plugin(ph, 'BlogLatestEntriesPlugin', language='en')
context = self.get_plugin_context(pages[0], 'en', plugin, edit=False)
rendered = plugin.render_plugin(context, ph)
# data is picked from both apphook configs
self.assertTrue(rendered.find('<article id="post-first-post"') > -1)
self.assertTrue(rendered.find('<article id="post-different-appconfig"') > -1)
def test_plugin_tags(self):
pages = self.get_pages()
posts = self.get_posts()