Permalink
Browse files

Added testcase for page objects for #1366. This issue doesn't apply t…

…o page-defined placeholders as codepath differs
  • Loading branch information...
1 parent 0897f8a commit 59d6353141e08cd956fed472b8b2efa9ace1bb9c @yakky committed Jul 29, 2012
Showing with 20 additions and 2 deletions.
  1. +20 −2 cms/tests/placeholder.py
View
@@ -181,8 +181,26 @@ def test_nested_plugin_escapejs(self):
pl_url = "%sedit-plugin/%s/" % (
reverse('admin:placeholderapp_example1_change', args=(ex.pk,)),
test_plugin.pk)
- response = self.client.post(pl_url, {
- })
+ response = self.client.post(pl_url, {})
+ self.assertContains(response,"/static/plugins/empty-image-file.png")
+
+ def test_nested_plugin_escapejs_page(self):
+ """
+ Sibling test of the above, on a page.
+ #1366 does not apply to placeholder defined in a page
+ """
+ with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSION=False):
+ page = create_page('page', 'col_two.html', 'en')
+ ph1 = page.placeholders.get(slot='col_left')
+ ###
+ # add the test plugin
+ ###
+ test_plugin = add_plugin(ph1, u"EmptyPlugin", u"en")
+ test_plugin.save()
+ pl_url = "%sedit-plugin/%s/" % (
+ reverse('admin:cms_page_change', args=(page.pk,)),
+ test_plugin.pk)
+ response = self.client.post(pl_url, {})
self.assertContains(response,"/static/plugins/empty-image-file.png")
def test_placeholder_scanning_fail(self):

0 comments on commit 59d6353

Please sign in to comment.