Exemplo n.º 1
0
def test_height():
    profile = {}
    P = parse_profile(profile)
    assert 'height' not in P

    profile = {'height': 500}
    P = parse_profile(profile)
    assert P['height'] == 500
def test_body_class():
    profile = {}
    P = parse_profile(profile)
    assert 'body_class' not in P

    profile = {'body_class': 'lol'}
    P = parse_profile(profile)
    assert P['body_class'] == 'lol'
def test_valid_children():
    profile = {}
    P = parse_profile(profile)
    assert 'valid_children' not in P

    profile = {'valid_children': 'lol'}
    P = parse_profile(profile)
    assert P['valid_children'] == 'lol'
def test_doctype():
    profile = {}
    P = parse_profile(profile)
    assert 'doctype' not in P

    profile = {'doctype': 'lol'}
    P = parse_profile(profile)
    assert 'doctype' in P
def test_block_formats():
    profile = {}
    P = parse_profile(profile)
    assert 'block_formats' not in P

    profile = {'block_formats': 'lol'}
    P = parse_profile(profile)
    assert P['block_formats'] == 'lol'
def test_invalid_styles():
    profile = {}
    P = parse_profile(profile)
    assert 'invalid_styles' not in P

    profile = {'invalid_styles': 'lol'}
    P = parse_profile(profile)
    assert P['invalid_styles'] == 'lol'
def test_invalid_elements():
    profile = {}
    P = parse_profile(profile)
    assert 'invalid_elements' not in P

    profile = {'invalid_elements': 'em,i'}
    P = parse_profile(profile)
    assert P['invalid_elements'] == 'em,i'
def test_valid_classes():
    profile = {}
    P = parse_profile(profile)
    assert 'valid_classes' not in P

    profile = {'valid_classes': 'lol'}
    P = parse_profile(profile)
    assert P['valid_classes'] == 'lol'
def test_content_css():
    profile = {}
    P = parse_profile(profile)
    assert 'content_css' not in P

    profile = {'content_css': 'lol'}
    P = parse_profile(profile)
    assert P['content_css'] == 'lol'
def test_visual_anchor_class():
    profile = {}
    P = parse_profile(profile)
    assert 'visual_anchor_class' not in P

    profile = {'visual_anchor_class': 'lol'}
    P = parse_profile(profile)
    assert P['visual_anchor_class'] == 'lol'
Exemplo n.º 11
0
def test_fixed_toolbar_container():
    profile = {}
    P = parse_profile(profile)
    assert 'fixed_toolbar_container' not in P

    profile = {'fixed_toolbar_container': 'lol'}
    P = parse_profile(profile)
    assert P['fixed_toolbar_container'] == 'lol'
Exemplo n.º 12
0
def test_event_root():
    profile = {}
    P = parse_profile(profile)
    assert 'event_root' not in P

    profile = {'event_root': 'lol'}
    P = parse_profile(profile)
    assert P['event_root'] == 'lol'
Exemplo n.º 13
0
def test_setup():
    profile = {}
    P = parse_profile(profile)
    assert 'setup' not in P

    profile = {'setup': 'lol'}
    P = parse_profile(profile)
    assert P['setup'] == 'lol'
Exemplo n.º 14
0
def test_file_browser_callback():
    profile = {}
    P = parse_profile(profile)
    assert 'file_browser_callback' not in P

    profile = {'file_browser_callback': 'lol'}
    P = parse_profile(profile)
    assert P['file_browser_callback'] == 'lol'
def test_body_id():
    profile = {}
    P = parse_profile(profile)
    assert 'body_id' not in P

    profile = {'body_id': 'lol'}
    P = parse_profile(profile)
    assert P['body_id'] == 'lol'
Exemplo n.º 16
0
def test_init_instance_callback():
    profile = {}
    P = parse_profile(profile)
    assert 'init_instance_callback' not in P

    profile = {'init_instance_callback': 'lol'}
    P = parse_profile(profile)
    assert P['init_instance_callback'] == 'lol'
Exemplo n.º 17
0
def test_skin_url():
    profile = {}
    P = parse_profile(profile)
    assert 'skin_url' not in P

    profile = {'skin_url': '/skin/'}
    P = parse_profile(profile)
    assert 'skin_url' in P
def test_indentation():
    profile = {}
    P = parse_profile(profile)
    assert 'indentation' not in P

    profile = {'indentation': '20pt'}
    P = parse_profile(profile)
    assert P['indentation'] == '20pt'
Exemplo n.º 19
0
def test_width():
    profile = {}
    P = parse_profile(profile)
    assert 'width' not in P

    profile = {'width': 500}
    P = parse_profile(profile)
    assert P['width'] == 500
Exemplo n.º 20
0
def test_language_url():
    profile = {}
    P = parse_profile(profile)
    assert 'language_url' not in P

    profile = {'language_url': 'lol'}
    P = parse_profile(profile)
    assert 'language_url' in P
def test_font_formats():
    profile = {}
    P = parse_profile(profile)
    assert 'font_formats' not in P

    profile = {'font_formats': 'lol'}
    P = parse_profile(profile)
    assert 'font_formats' in P
    assert P['font_formats'] == 'lol'
Exemplo n.º 22
0
def test_selector():
    profile = {}
    P = parse_profile(profile)
    assert 'selector' not in P

    profile = {'selector': 'textarea'}
    P = parse_profile(profile)
    assert 'selector' in P
    assert P['selector'] == 'textarea'
def test_extended_valid_elements():
    profile = {}
    P = parse_profile(profile)
    assert 'extended_valid_elements' not in P

    profile = {'extended_valid_elements': 'img[class|src|name]'}
    P = parse_profile(profile)
    assert 'extended_valid_elements' in P
    assert P['extended_valid_elements'] == 'img[class|src|name]'
def test_entities():
    profile = {}
    P = parse_profile(profile)
    assert 'entities' not in P

    profile = {'entities': '160,nbsp,162,cent,8364,euro,163,pound'}
    P = parse_profile(profile)
    assert 'entities' in P
    assert P['entities'] == '160,nbsp,162,cent,8364,euro,163,pound'
Exemplo n.º 25
0
def test_auto_focus():
    profile = {}
    P = parse_profile(profile)
    assert 'auto_focus' not in P

    profile = {'auto_focus': 'elm1'}
    P = parse_profile(profile)
    assert 'auto_focus' in P
    assert P.get('auto_focus') == 'elm1'
def test_forced_root_block_attrs():
    profile = {}
    P = parse_profile(profile)
    assert 'forced_root_block_attrs' not in P

    profile = {'forced_root_block_attrs': {'lol': 'lol'}}
    P = parse_profile(profile)
    assert 'forced_root_block_attrs' in P
    assert P['forced_root_block_attrs'] == {'lol': 'lol'}
Exemplo n.º 27
0
def test_theme_url():
    profile = {}
    P = parse_profile(profile)
    assert 'theme_url' not in P

    profile = {'theme_url': '/theme/url/'}
    P = parse_profile(profile)
    assert 'theme_url' in P
    assert P['theme_url'] == '/theme/url/'
Exemplo n.º 28
0
def test_toolbar():
    # FIXME: check docs, test all
    profile = {}
    P = parse_profile(profile)
    assert 'toolbar' not in P

    profile = {'toolbar': 'lol'}
    P = parse_profile(profile)
    assert P['toolbar'] == 'lol'
Exemplo n.º 29
0
def test_object_resizing():
    # FIXME: check default options in tinymce
    profile = {}
    P = parse_profile(profile)
    assert 'object_resizing' not in P

    profile = {'object_resizing': 'img'}
    P = parse_profile(profile)
    assert 'object_resizing' in P
    assert P['object_resizing'] == 'img'
Exemplo n.º 30
0
def test_hidden_input():
    # FIXME: check what's default
    profile = {}
    P = parse_profile(profile)
    assert 'hidden_input' not in P

    profile = {'hidden_input': False}
    P = parse_profile(profile)
    assert 'hidden_input' in P
    assert P['hidden_input'] == False
Exemplo n.º 31
0
def test_file_browser_callback_types():
    profile = {}
    P = parse_profile(profile)
    assert 'file_browser_callback_types' not in P

    profile = {'file_browser_callback_types': 'file image media'}
    P = parse_profile(profile)
    assert P['file_browser_callback_types'] == 'file image media'

    profile = {'file_browser_callback_types': 'lol'}
    with raises(ConfigurationError):
        P = parse_profile(profile)
Exemplo n.º 32
0
def test_custom_undo_redo_levels():
    profile = {}
    P = parse_profile(profile)
    assert 'custom_undo_redo_levels' not in P

    profile = {'custom_undo_redo_levels': 10}
    P = parse_profile(profile)
    assert P['custom_undo_redo_levels'] == 10

    profile = {'custom_undo_redo_levels': 'lol'}
    with raises(ConfigurationError):
        P = parse_profile(profile)
Exemplo n.º 33
0
def test_keep_styles():
    profile = {}
    P = parse_profile(profile)
    assert 'keep_styles' not in P

    profile = {'keep_styles': False}
    P = parse_profile(profile)
    assert P['keep_styles'] == False

    profile = {'keep_styles': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 34
0
def test_forced_root_block():
    profile = {}
    P = parse_profile(profile)
    assert 'forced_root_block' not in P

    profile = {'forced_root_block': 'p'}
    P = parse_profile(profile)
    assert P['forced_root_block'] == 'p'

    profile = {'forced_root_block': False}
    P = parse_profile(profile)
    assert P['forced_root_block'] == False
Exemplo n.º 35
0
def test_external_plugins():
    profile = {}
    P = parse_profile(profile)
    assert 'external_plugins' not in P

    profile = {
        'external_plugins': {
            'myplugin': '/external/plugin.js',
        }
    }
    P = parse_profile(profile)
    assert 'external_plugins' in P
    assert P['external_plugins'] == {'myplugin': '/external/plugin.js'}
Exemplo n.º 36
0
def test_convert_fonts_to_spans():
    profile = {}
    P = parse_profile(profile)
    assert 'convert_fonts_to_spans' in P
    assert P['convert_fonts_to_spans'] == True

    profile = {'convert_fonts_to_spans': True}
    P = parse_profile(profile)
    assert 'convert_fonts_to_spans' in P
    assert P['convert_fonts_to_spans'] == True

    profile = {'convert_fonts_to_spans': False}
    P = parse_profile(profile)
    assert 'convert_fonts_to_spans' in P
    assert P['convert_fonts_to_spans'] == False
Exemplo n.º 37
0
def test_protect():
    profile = {}
    P = parse_profile(profile)
    assert 'protect' not in P

    profile = {'protect': ['a', 'b']}
    P = parse_profile(profile)
    assert P['protect'] == ['a', 'b']

    profile = {'protect': ('a', 'b')}
    P = parse_profile(profile)
    assert P['protect'] == ('a', 'b')

    profile = {'protect': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
def test_visual():
    profile = {}
    P = parse_profile(profile)
    assert 'visual' not in P

    profile = {'visual': True}
    P = parse_profile(profile)
    assert P['visual'] == True

    profile = {'visual': False}
    P = parse_profile(profile)
    assert P['visual'] == False

    profile = {'visual': 'lol'}
    with raises(ConfigurationError):
        P = parse_profile(profile)
Exemplo n.º 39
0
def test_force_hex_style_colors():
    profile = {}
    P = parse_profile(profile)
    assert 'force_hex_style_colors' not in P

    profile = {'force_hex_style_colors': True}
    P = parse_profile(profile)
    assert P['force_hex_style_colors'] == True

    profile = {'force_hex_style_colors': False}
    P = parse_profile(profile)
    assert P['force_hex_style_colors'] == False

    profile = {'force_hex_style_colors': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 40
0
def test_directionality():
    profile = {}
    P = parse_profile(profile)
    assert 'directionality' in P
    assert P['directionality'] == 'ltr'

    profile = {'directionality': 'ltr'}
    P = parse_profile(profile)
    assert 'directionality' in P
    assert P['directionality'] == 'ltr'

    profile = {'directionality': 'rtl'}
    P = parse_profile(profile)
    assert 'directionality' in P
    assert P['directionality'] == 'rtl'

    profile = {'directionality': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 41
0
def test_browser_spellcheck():
    profile = {}
    P = parse_profile(profile)
    assert 'browser_spellcheck' in P
    assert P['browser_spellcheck'] == False

    profile = {'browser_spellcheck': False}
    P = parse_profile(profile)
    assert 'browser_spellcheck' in P
    assert P['browser_spellcheck'] == False

    profile = {'browser_spellcheck': True}
    P = parse_profile(profile)
    assert 'browser_spellcheck' in P
    assert P['browser_spellcheck'] == True

    profile = {'browser_spellcheck': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 42
0
def test_nowrap():
    profile = {}
    P = parse_profile(profile)
    assert 'nowrap' in P
    assert P['nowrap'] == False

    profile = {'nowrap': False}
    P = parse_profile(profile)
    assert 'nowrap' in P
    assert P['nowrap'] == False

    profile = {'nowrap': True}
    P = parse_profile(profile)
    assert 'nowrap' in P
    assert P['nowrap'] == True

    profile = {'nowrap': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 43
0
def test_fix_list_elements():
    profile = {}
    P = parse_profile(profile)
    assert 'fix_list_elements' in P
    assert P['fix_list_elements'] == False

    profile = {'fix_list_elements': False}
    P = parse_profile(profile)
    assert 'fix_list_elements' in P
    assert P['fix_list_elements'] == False

    profile = {'fix_list_elements': True}
    P = parse_profile(profile)
    assert 'fix_list_elements' in P
    assert P['fix_list_elements'] == True

    profile = {'fix_list_elements': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 44
0
def test_element_format():
    profile = {}
    P = parse_profile(profile)
    assert 'element_format' in P
    assert P['element_format'] == 'xhtml'

    profile = {'element_format': 'xhtml'}
    P = parse_profile(profile)
    assert 'element_format' in P
    assert P['element_format'] == 'xhtml'

    profile = {'element_format': 'html'}
    P = parse_profile(profile)
    assert 'element_format' in P
    assert P['element_format'] == 'html'

    profile = {'element_format': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 45
0
def test_force_p_newlines():
    # FIXME: check default state
    profile = {}
    P = parse_profile(profile)
    assert 'force_p_newlines' not in P
    #assert P['force_p_newlines'] == True

    profile = {'force_p_newlines': True}
    P = parse_profile(profile)
    assert 'force_p_newlines' in P
    assert P['force_p_newlines'] == True

    profile = {'force_p_newlines': False}
    P = parse_profile(profile)
    assert 'force_p_newlines' in P
    assert P['force_p_newlines'] == False

    profile = {'force_p_newlines': 'lol'}
    with raises(ConfigurationError) as ex:
        P = parse_profile(profile)
Exemplo n.º 46
0
def test_resize():
    profile = {}
    P = parse_profile(profile)
    assert 'resize' not in P

    profile = {'resize': True}
    P = parse_profile(profile)
    assert P['resize'] == True

    profile = {'resize': False}
    P = parse_profile(profile)
    assert P['resize'] == False

    profile = {'resize': 'both'}
    P = parse_profile(profile)
    assert P['resize'] == 'both'

    profile = {'resize': 'lol'}
    with raises(ConfigurationError):
        P = parse_profile(profile)
Exemplo n.º 47
0
def test_plugins():
    # FIXME: check all plugins
    profile = {}
    P = parse_profile(profile)
    assert 'plugins' not in P