+
+
+class ContainerTestCase(TestCase):
+ def test_simple_containers(self):
+ t = Template(code="{% container one %}{% container two %}{% container three %}{% container two %}")
+ contentlet_specs, contentreference_specs = t.containers
+ self.assertEqual(len(contentreference_specs.keyOrder), 0)
+ self.assertEqual(contentlet_specs, ['one', 'two', 'three'])
+
+ ct = ContentType.objects.get_for_model(Tag)
+ t = Template(code="{% container one references philo.tag as tag1 %}{% container two references philo.tag as tag2 %}{% container one references philo.tag as tag1 %}")
+ contentlet_specs, contentreference_specs = t.containers
+ self.assertEqual(len(contentlet_specs), 0)
+ self.assertEqual(contentreference_specs, SortedDict([('one', ct), ('two', ct)]))