Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test for template magic

  • Loading branch information...
commit b03897ecfa1386131778c0e6d79173b3a06e5395 1 parent 2cc8cde
@ojii ojii authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 cms/tests/page.py
View
15 cms/tests/page.py
@@ -291,3 +291,18 @@ def test_14_flat_urls(self):
response = self.client.get(grandchild.get_absolute_url())
self.assertEqual(response.status_code, 200)
self.assertFalse(child.get_absolute_url() in grandchild.get_absolute_url())
+
+ def test_15_templates(self):
+ """
+ Test the inheritance magic for templates
+ """
+ parent = self.new_create_page()
+ child = self.new_create_page(parent)
+ child.template = settings.CMS_TEMPLATE_INHERITANCE_MAGIC
+ child.save()
+ self.assertEqual(child.template, settings.CMS_TEMPLATE_INHERITANCE_MAGIC)
+ self.assertEqual(parent.get_template(), child.get_template())
+ parent.template = settings.CMS_TEMPLATE_INHERITANCE_MAGIC
+ parent.save()
+ self.assertEqual(parent.template, settings.CMS_TEMPLATE_INHERITANCE_MAGIC)
+ self.assertEqual(parent.get_template(), settings.CMS_TEMPLATES[0][0])
Please sign in to comment.
Something went wrong with that request. Please try again.