예제 #1
0
파일: tests.py 프로젝트: nimbis/mezzanine
    def test_downcast_two_levels(self):
        """
        Test the downcast function two levels
        """
        # Create a subclass
        x = FooPage.objects.create()

        # Retrieve the grandparent class
        page = Page.objects.get(pk=x.pk)
        y = downcast(page, "richtextpage__foopage")
        self.assertEqual(type(y), FooPage)
예제 #2
0
파일: tests.py 프로젝트: nimbis/mezzanine
    def test_downcast_one_level(self):
        """
        Test the downcast function one level
        """
        # Create a subclass
        x = FooPage.objects.create()

        # Retrieve the grandparent class
        page = Page.objects.get(pk=x.pk)
        y = downcast(page, "richtextpage")
        self.assertEqual(type(y), RichTextPage)