Permalink
Browse files

Improved test to catch issue #786.

  • Loading branch information...
1 parent b95150a commit 69af4ac076226fcc3e5177fd352714fc1b0c53f3 @mitar committed May 11, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 cms/tests/plugins.py
View
7 cms/tests/plugins.py
@@ -165,8 +165,10 @@ def test_02_copy_plugins(self):
}
response = self.client.post(edit_url, data)
self.assertEqual(response.status_code, 200)
+ # before copying text plugin has only one child
+ self.assertEquals(CMSPlugin.objects.filter(parent=txt.pk).count(), 1)
self.assertEqual(CMSPlugin.objects.get(pk=link_pk).parent.pk, txt.pk)
- #create 2nd language page
+ # create 2nd language page
page_data['language'] = settings.LANGUAGES[1][0]
page_data['title'] += " %s" % settings.LANGUAGES[1][0]
response = self.client.post(URL_CMS_PAGE_CHANGE % page.pk + "?language=%s" % settings.LANGUAGES[1][0], page_data)
@@ -186,6 +188,9 @@ def test_02_copy_plugins(self):
self.assertEquals(CMSPlugin.objects.filter(language=settings.LANGUAGES[0][0]).count(), 2)
self.assertEquals(CMSPlugin.objects.filter(language=settings.LANGUAGES[1][0]).count(), 2)
self.assertEquals(CMSPlugin.objects.all().count(), 4)
+ # after copying text plugin should have still only one child
+ self.assertEquals(CMSPlugin.objects.filter(parent=txt.pk).count(), 1)
+ self.assertEqual(CMSPlugin.objects.get(pk=link_pk).parent.pk, txt.pk)
# assert plugin tree
for link in CMSPlugin.objects.filter(plugin_type="LinkPlugin"):
self.assertNotEqual(link.parent, None)

0 comments on commit 69af4ac

Please sign in to comment.