예제 #1
0
 def test_get_template_choices(self):
     self.assertEqual((
         ('', '--------'),
         ('pages.landingpage', 'Pages | Landing Page'),
         ('pages.basicpage', 'Pages | Basic Page'),
         ('pages.otherpage', 'Pages | Some Other Page'),
     ), page_content.get_template_choices())
예제 #2
0
 def __init__(self, *args, **kwargs):
     super(PageAdminForm, self).__init__(*args, **kwargs)
     self.fields['template'].choices = page_content.get_template_choices()
     self.fields['parent'].widget.can_add_related = False
     self.fields['parent'].widget.can_change_related = False
     if self.instance:
         self.fields['parent'].queryset = Page.objects.exclude(
                 id=self.instance.id)
예제 #3
0
 def test_get_template_choices(self):
     self.assertEqual((
         ('', '--------'),
         ('pages.landingpage', 'Pages | Landing Page'),
         ('pages.basicpage', 'Pages | Basic Page'),
         ('pages.basicpagefunc', 'Pages | Basic Page Func'),
         ('pages.otherpage', 'Pages | Some Other Page'),
     ), page_content.get_template_choices())
예제 #4
0
 def __init__(self, *args, **kwargs):
     super(PageAdminForm, self).__init__(*args, **kwargs)
     self.fields['template'].choices = page_content.get_template_choices()