Ejemplo n.º 1
0
def test_form_settings_can_be_iterated_as_choices(settings):
    settings.FP_FORM_BLOCK_CHOICES = {}
    config = BlockFormSettings()
    config.update({'default': {'name': 'The Default'}})
    config.update({'test': {'name': 'Another form'}})

    assert tuple(config.as_choices()) == (('default', 'The Default'),
                                          ('test', 'Another form'))
Ejemplo n.º 2
0
def test_form_settings_can_be_iterated_as_choices(settings):
    settings.FP_FORM_BLOCK_CHOICES = {}
    config = BlockFormSettings()
    config.update({'default': {'name': 'The Default'}})
    config.update({'test': {'name': 'Another form'}})

    assert tuple(config.as_choices()) == (('default', 'The Default'),
                                          ('test', 'Another form'))
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     super(FormBlockForm, self).__init__(*args, **kwargs)
     from fancypages.helpers import BlockFormSettings
     settings = BlockFormSettings()
     self.fields['form_selection'].choices = tuple(settings.as_choices())
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(FormBlockForm, self).__init__(*args, **kwargs)
     from fancypages.helpers import BlockFormSettings
     settings = BlockFormSettings()
     self.fields['form_selection'].choices = tuple(settings.as_choices())