tests package
Submodules
tests.test_decorators module
Tests for Decorators
- class tests.test_decorators.DecoratorTestCase(methodName='runTest')
Bases:
TestCase
Test Decorators
- setUp()
Hook method for setting up the test fixture before exercising it.
- test_login_required_decorator_works()
Test login_required decorator works
- test_login_required_decorator_works_when_user_not_logged_in()
Test login_required decorator works when user not logged in
- test_permission_required_one_works_when_permission_is_a_string()
Test permission_required_one works when permission is a string
- test_permission_required_one_works_when_user_has_all()
Test permission_required_one work when user has all
- test_permission_required_one_works_when_user_has_none()
Test permission_required_one works when user has none
- test_permission_required_one_works_when_user_has_none_and_raise_exception()
Test permission_required_one works when user has none and raise exception
- test_permission_required_one_works_when_user_has_one()
Test permission_required_one works when user has one
- test_permission_required_works_when_permission_is_a_string()
Test permission_required works when permission is a string
- test_permission_required_works_when_user_has_all()
Test permission_required works when user has all
- test_permission_required_works_when_user_has_none()
Test permission_required works when user has none
- test_permission_required_works_when_user_has_none_and_raise_exception()
Test permission_required works when user has none and raise exception
- test_permission_required_works_when_user_has_one()
Test permission_required works when user has one
tests.test_mixins module
Tests for Mixins
- class tests.test_mixins.MixinTestCase(methodName='runTest')
Bases:
TestCase
Test Mixins
- setUp()
Hook method for setting up the test fixture before exercising it.
- test_login_required_mixin_works()
Test login_required mixin works
- test_login_required_mixin_works_when_user_not_logged_in()
Test login_required mixin works when user not logged in
- test_mixin_has_error_when_no_permissions_defined()
Test mixin has error when no permissions defined
- test_mixin_prevents_access_for_no_perms_all()
Test mixin prevents access for no perms all
- test_mixin_prevents_access_for_no_perms_one()
Test mixin prevents access for no perms one
- test_mixin_works_with_permission_required_defined()
Test mixin works with permission required defined
- test_mixin_works_with_permission_required_defined_as_string()
Test mixin works with permission required defined
- test_mixin_works_with_permission_required_one_defined()
Test mixing works with permission required one defined
- test_mixin_works_with_permission_required_one_defined_as_string()
Test mixing works with permission required one defined
tests.test_templatetags module
Tests for Template Tags
- class tests.test_templatetags.TemplateTagTestCase(methodName='runTest')
Bases:
TestCase
Test Template Tags and Helper Methods used in those template tags
- class TestForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)
Bases:
Form
Test Form
- adminlte2_show_field_errors_in_summary = True
- base_fields = {'test_checkbox': <django.forms.fields.BooleanField object>, 'test_date': <django.forms.fields.DateField object>, 'test_hidden': <django.forms.fields.CharField object>, 'test_select': <django.forms.fields.ChoiceField object>, 'test_text': <django.forms.fields.CharField object>}
- declared_fields = {'test_checkbox': <django.forms.fields.BooleanField object>, 'test_date': <django.forms.fields.DateField object>, 'test_hidden': <django.forms.fields.CharField object>, 'test_select': <django.forms.fields.ChoiceField object>, 'test_text': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- assertInHTML(needle, haystack, **kwargs)
Override assertInHTML to show response if not found
- assertNotInHTML(needle, haystack, **kwargs)
Creates a new method to ensure that HTML does not show up
- setUp()
Hook method for setting up the test fixture before exercising it.
- test_dictionary_lists_the_directory_of_an_object()
Test dictionary lists the directory of an object
- test_dir_lists_the_directory_of_an_object()
Test dir lists the directory of an object
- test_fieldtype_returns_the_correct_fieldtype_for_checkbox_field()
Test fieldtype returns the correct fieldtype for checkbox field
- test_fieldtype_returns_the_correct_fieldtype_for_date_field()
Test fieldtype returns the correct fieldtype for date field
- test_fieldtype_returns_the_correct_fieldtype_for_hidden_field()
Test fieldtype returns the correct fieldtype for hidden field
- test_fieldtype_returns_the_correct_fieldtype_for_select_field()
Test fieldtype returns the correct fieldtype for select field
- test_fieldtype_returns_the_correct_fieldtype_for_text_field()
Test fieldtype returns the correct fieldtype for text field
- test_get_avatar_url_returns_an_actual_gravatar_url_when_the_user_has_a_gravatar()
Test get avatar url returns an actual gravatar url when the user has a gravatar
- test_get_avatar_url_returns_the_default_url_when_the_user_is_anonymous()
Test get avatar url returns the default url when the user is anonymous
- test_get_logout_url_returns_correct_url_when_there_is_an_entry_in_settings()
Test get logout url returns correct url when there is an entry in settings
- test_get_logout_url_returns_correct_url_when_there_is_not_an_entry_in_the_settings_and_default_is_used()
Test get logout url returns correct url when there is not an entry in the settings and default is used
- test_render_form_correctly_renders_a_form()
Test render form correctly renders a form
- test_render_form_error_summary_displays_field_errors_for_a_list_of_forms_each_with_one_field_error()
Test render form error summary displays field errors for a list of forms each with one field error
- test_render_form_error_summary_displays_field_errors_for_a_list_of_formsets_with_one_field_error()
Test render form error summary displays field errors for a list of formsets with one field error
- test_render_form_error_summary_displays_field_errors_for_a_single_form_with_one_field_error()
Test render form error summary displays field errors for a single form with one field error
- test_render_form_error_summary_displays_field_errors_for_a_single_formset_with_one_field_error()
Test render form error summary displays field errors for a single formset with one field error
- test_render_form_error_summary_displays_form_error_for_a_single_formset_with_one_form_error()
Test render form error summary displays form error for a single formset with one form error
- test_render_form_error_summary_displays_form_errors_for_a_single_form_with_one_form_error()
Test render form error summary displays form errors for a single form with one form error
- test_render_form_error_summary_displays_formset_errors_for_a_single_formset_with_one_formset_error()
Test render form error summary displays formset errors for a single formset with one formset error
- test_render_form_error_summary_does_not_display_errors_if_there_are_none_for_a_form()
Test render form error summary does not display errors if there are non for a form
- test_render_form_error_summary_does_not_display_errors_if_there_are_none_for_formset()
Test render form error summary does not display errors if there are none for formset
- test_render_form_renders_no_fields_when_form_is_none()
Test render form renders no fields when form is none
- test_render_horizontal_form_correctly_renders_a_horizontal_form()
Test render horizontal form correctly renders a horizontal form
- test_render_horizontal_form_renders_no_fields_when_form_is_none()
Test render horizontal form renders no fields when form is none
- test_render_horizontal_formset_correctly_renders_a_horizontal_formset()
Test render horizontal formset correctly renders a horizontal formset
- test_unslugify_converts_underscore_to_spaces_and_capitalizes_first_letter()
Test unslugify converts underscore to spaces and capitalizes first letter
- test_unsnake_converts_underscore_to_spaces_and_capitalizes_first_letter()
Test unsnake converts underscore to spaces and capitalizes first letter
- test_update_errors_with_form_data_returns_an_unmodified_errors_dict_if_the_form_does_not_have_use_error_summary_set()
Test update errors with form data returns an unmodified errors dict if the form does not have use error summary set
- test_update_errors_with_form_data_returns_errors_for_form_with_one_form_error()
Test update errors with form data returns errors for form with one form error
- test_update_errors_with_form_data_returns_errors_for_form_with_one_form_error_and_one_field_error()
Test update errors with form data returns errors for form with one form error and one field error
- test_update_errors_with_form_data_returns_errors_for_form_with_one_form_error_and_one_field_error_and_form_with_display_in_summary_disabled()
Test update errors with form data returns errors for form with one form error and one field error and form with display in summary disabled
- test_update_errors_with_form_data_returns_errors_for_form_with_one_form_field_error()
Test update errors with form data returns errors for form with one form field error
- test_update_errors_with_form_data_throws_attribute_error_when_form_is_not_a_valid_form()
Test update errors with form data throws attribute error when form is not a valid form
- test_update_errors_with_formset_data_returns_an_unmodified_errors_dict_if_the_form_does_not_have_use_error_summary_set()
Test update errors with formset data returns an unmodified errors dict if the form does not have use error summary set
- test_update_errors_with_formset_data_returns_errors_for_formset_with_one_form_error()
Test update errors with formset data returns errors for formset with one form error
- test_update_errors_with_formset_data_returns_errors_for_formset_with_one_form_field_error()
Test update errors with formset data returns errors for formset with one form field error
- test_update_errors_with_formset_data_returns_errors_for_formset_with_one_formset_error()
Test update errors with formset data returns errors for formset with one formset error
- test_update_errors_with_formset_data_throws_attribute_error_when_formset_is_not_a_valid_formset()
Test update errors with formset data throws attribute error when formset is not a valid formset
- test_user_image_initials_returns_user_div_correctly_with_no_arguments()
Test user image initials returns user dive correctly with no arguments
- test_user_image_initials_returns_user_div_correctly_with_passed_f_and_l_names()
Test user image initials returns user div correctly with passed f and l names
- test_user_image_initials_returns_user_div_correctly_with_passed_f_name_only()
Test user image initials returns user div correctly with passed f name only
- test_user_image_initials_returns_user_div_correctly_with_passed_initials()
Test user image initials returns user div correctly with passed initials
- test_user_image_initials_returns_user_div_correctly_with_passed_l_name_only()
Test user image initials returns user div correctly with passed l name only
- test_user_image_initials_returns_user_div_correctly_with_passed_user()
Test user image initials returns user div correctly with passed user
- test_user_image_initials_returns_user_div_correctly_with_passed_user_and_overrides()
Test user image initials returns user div correctly with passed user and overrides
- test_with_attrs_adds_attributes_to_an_existing_form_field()
Test with attrs adds attributes to an existring form field
- test_with_class_adds_a_class_to_an_existing_form_field()
Test with class adds a class to an existing form field
- test_with_class_handles_missing_field()
Test with class handles missing field
- test_with_data_adds_data_attributes_to_an_existing_form_field()
Test with data adds data attributes to an existing form field
- test_with_input_type_changes_the_input_type_of_an_existing_form_field()
Test with input type changes the input_type of an existing form field
- test_with_inputmask_adds_a_default_inputmask_attribute_to_an_existing_form_field()
Test with inputmask adds a default inputmask attribute to an existing form field
- test_with_inputmask_adds_a_specific_inputmask_attribute_to_an_existing_form_field()
Test with inputmask adds a specific inputmask attribute to an existing form field
- test_with_list_adds_a_default_list_attribute_to_an_existing_form_field()
Test with list adds a default list attribute to an existing form field
- test_with_list_adds_a_specific_list_attribute_to_an_existing_form_field()
Test with list adds a specific list attribute to an existing form field
- test_with_max_adds_a_default_max_attribute_to_an_existing_form_field()
Test with max adds a default max attribute to an existing form field
- test_with_max_adds_a_specific_max_attribute_to_an_existing_form_field()
Test with max adds a specific max attribute to an existing form field
- test_with_min_adds_a_default_min_attribute_to_an_existing_form_field()
Test with min adds a default min attribute to an existing form field
- test_with_min_adds_a_specific_min_attribute_to_an_existing_form_field()
Test with min adds a specific min attribute to an existing form field
- test_with_pattern_adds_a_default_pattern_attribute_to_an_existing_form_field()
Test with pattern adds a default pattern attribute to an existing form field
- test_with_pattern_adds_a_specific_pattern_attribute_to_an_existing_form_field()
Test with pattern adds a specific pattern attribute to an existing form field
- test_with_placeholder_adds_a_default_placeholder_attribute_to_an_existing_form_field()
Test with placeholder adds a default placeholder attribute to an existing form field
- test_with_placeholder_adds_a_specific_placeholder_attribute_to_an_existing_form_field()
Test with placeholder adds a specific placeholder attribute to an existing form field
- test_with_placeholder_does_not_override_existing_placeholder_on_an_existing_form_field()
Test with placeholder does not override existing placeholder on an existing form field
tests.test_templatetags_admin module
Tests for Admin Template Tags
- class tests.test_templatetags_admin.TemplateTagAdminTestCase(methodName='runTest')
Bases:
TestCase
Test Template Tags
- test_index_app_display_shows_box_when_setting_is_false()
Test index app display shows box when setting is false
- test_index_app_display_shows_list_when_setting_is_true()
Test index app display shows list when setting is true
- test_show_control_sidebar_button_is_missing_when_settings_hides_all_tabs_to_show()
Test show control sidebar button is missing when settings hides all tabs to show
- test_show_control_sidebar_button_shows_up_when_settings_are_left_as_default_tabs_to_show()
Test show control sidebar button shows up when settings are left as default tabs to show
- test_show_control_sidebar_button_shows_up_when_settings_defines_all_tabs_to_show()
Test show control sidebar button shows up when settings defines all tabs to show
- test_show_control_sidebar_extra_tab_panes_displays_when_setting_is_true()
Test show control sidebar extra tab panes displays when setting is true
- test_show_control_sidebar_extra_tab_panes_is_hidden_when_setting_is_default()
Test show control sidebar extra tab panes is hidden when setting is default
- test_show_control_sidebar_extra_tab_panes_is_hidden_when_setting_is_false()
Test show control sidebar extra tab panes is hidden when setting is false
- test_show_control_sidebar_recent_activity_tab_pane_displays_when_setting_is_default()
Test show control sidebar recent activity tab pane displays when setting is default
- test_show_control_sidebar_recent_activity_tab_pane_displays_when_setting_is_true()
Test show control sidebar recent activity tab pane displays when setting is true
- test_show_control_sidebar_recent_activity_tab_pane_is_hidden_when_setting_is_false()
Tests show control sidebar recent activity tab pane is hidden when setting is false
- test_show_control_sidebar_settings_tab_pane_displays_when_setting_is_true()
Test show control sidebar settings tab pane displays when setting is true
- test_show_control_sidebar_settings_tab_pane_is_hidden_when_setting_is_default()
Test show control sidebar settings tab pane is hidden when setting is default
- test_show_control_sidebar_settings_tab_pane_is_hidden_when_setting_is_false()
Test show control sidebar settings tab pane is hidden when setting is false
- test_show_control_sidebar_tabs_displays_the_enabled_tab_by_itself_and_not_as_a_tab_when_there_is_only_one()
Test show control sidebar tabs displays the enabled tab by itself and not as a tab when there is only one
- test_show_control_sidebar_tabs_displays_the_enabled_tabs_as_tabs_when_there_is_more_than_one()
Test show control sidebar tabs displays the enabled tabs as tabs when there is more than one
tests.test_templatetags_admin_menu module
Tests for Admin Menu Template Tags
- class tests.test_templatetags_admin_menu.TemplateTagAdminMenuTestCase(methodName='runTest')
Bases:
TestCase
Test Template Tags
- create_user()
Create a dummy user for views to access.
- test_render_admin_fails_for_staff_with_defined_available_apps_in_context_that_has_no_urls()
Test render admin fails for staff with defined available apps in context that has no urls
- test_render_admin_menu_works_for_staff_with_default_settings()
Test render admin menu works for staff with default settings
- test_render_admin_menu_works_for_superuser_with_admin_menu_in_tree_settings()
Test render admin menu works for superuser with admin menu in tree settings
- test_render_admin_menu_works_for_superuser_with_default_settings()
Test render admin menu works for superuser with default settings
- test_render_admin_menu_works_for_superuser_with_include_main_nav()
Test render admin menu works for superuser with include main name
- test_render_admin_removes_no_perm_urls_for_staff_with_defined_available_apps_in_context_and_no_associated_permissions()
Test render admin removes no perm urls for staff with defined available apps in context and no associated permissions
- test_render_admin_renders_correctly_with_menu_group_separator_disabled_and_one_additional_menu()
Test render admin renders correctly with menu group separator disabled and one additional menu
- test_render_admin_renders_correctly_with_menu_group_separator_enabled_and_all_additional_menus()
Test render admin renders correctly with menu group separator enabled and all additional menus
- test_render_admin_renders_correctly_with_menu_group_separator_enabled_and_no_additional_menus()
Test render admin renders correctly with menu group separator enabled and no additional menus
- test_render_admin_renders_correctly_with_menu_group_separator_enabled_and_one_additional_menu()
Test render admin renders correctly with menu group separator enabled and one additional menu
- test_render_admin_renders_correctly_with_menu_group_separator_enabled_and_only_admin_menu()
Test render admin renders correctly with menu group separator enabled and only admin menu
- test_render_admin_tree_icon_tag_renders_the_icon_after_it_has_been_changed()
Test render admin tree icon tag renders the icon after it has been changed
- test_render_admin_tree_icon_tag_renders_the_icon_when_it_is_the_default()
Test render admin tree icon tag renders the icon when it is the default
- test_render_admin_works_for_superuser_with_defined_available_apps_in_context()
Test render admin works for superuser with defined available apps in context
- test_render_app_icon_tag_renders_the_icon_after_it_has_been_changed()
Test render app icon tag renders the icon after it has been changed
- test_render_app_icon_tag_renders_the_icon_when_it_is_the_default()
Test render app icon tag renders the icon when it is the default
- test_render_model_icon_tag_renders_the_icon_after_it_has_been_changed()
Test render model icon tag renders the icon after it has been changed
- test_render_model_icon_tag_renders_the_icon_when_it_is_the_default()
Test render model icon tag renders the icon when it is the default
tests.test_templatetags_sidebar_menu module
Tests for Template Tags
- class tests.test_templatetags_sidebar_menu.TemplateTagSidebarMenuTestCase(methodName='runTest')
Bases:
TestCase
Test Template Tags and Helper Methods used in those template tags
- setUp()
Hook method for setting up the test fixture before exercising it.
- test_check_for_all_permissions_returns_false_when_permissions_is_empty_list()
Test check for all permissions returns false when permissions is empty list
- test_check_for_all_permissions_returns_false_when_user_does_not_have_perms()
Test check for all permissions returns false when user does not have perms
- test_check_for_all_permissions_returns_true_when_user_is_not_su_but_has_perms()
Test check for all permissions returns true when user is not su but has perms
- test_check_for_all_permissions_returns_true_when_user_is_superuser()
Test check for all permissions returns true when user is superuser
- test_check_for_login_whitelisted_node_returns_false_when_node_not_in_list()
Test check for strict whitelisted node returns false when node not in list
- test_check_for_login_whitelisted_node_returns_true_when_node_in_list()
Test check for strict whitelisted node returns true when node in list
- test_check_for_node_that_matches_request_path_returns_false_for_no_nodes()
Test check for node that matches request path returns false for no nodes
- test_check_for_node_that_matches_request_path_returns_false_for_single_node_without_a_match()
Test check for node that matches request path returns false for single node without a match
- test_check_for_node_that_matches_request_path_returns_false_for_tree_of_three_nodes_without_a_match()
Test check for node that matches request path returns false for tree of three nodes without a match
- test_check_for_node_that_matches_request_path_returns_false_for_tree_of_two_nodes_without_a_match()
Test check for node that matches request path returns false for tree of two nodes without a match
- test_check_for_node_that_matches_request_path_returns_true_for_single_node_with_a_match()
Test check for node that matches request path returns true for single node with a match
- test_check_for_node_that_matches_request_path_returns_true_for_tree_of_three_nodes_with_a_match()
Test check for node that matches request path returns true for tree of three nodes with a match
- test_check_for_node_that_matches_request_path_returns_true_for_tree_of_two_nodes_with_a_match()
Test check for node that matches request path returns true for tree of two nodes with a match
- test_check_for_one_permission_in_node_list_returns_false_for_single_node_user_can_not_access()
Test check for one permission in node list returns false for single node user can not access
- test_check_for_one_permission_in_node_list_returns_false_for_tree_of_three_nodes_user_can_not_access()
Test check for one permission in node list returns false for tree of three nodes user can not access
- test_check_for_one_permission_in_node_list_returns_false_for_tree_of_two_nodes_user_can_not_access()
Test check for one permission in node list returns false for tree of two nodes user can not access
- test_check_for_one_permission_in_node_list_returns_true_for_single_node_user_can_access()
Test check for one permission in node list returns true for single node user can access
- test_check_for_one_permission_in_node_list_returns_true_for_superuser_regardless_of_tree_size()
Test check for one permission in node list returns true for superuser regardless of tree size
- test_check_for_one_permission_in_node_list_returns_true_for_tree_of_three_nodes_user_can_access()
Test check for one permission in node list returns true for three of three nodes user can access
- test_check_for_one_permission_in_node_list_returns_true_for_tree_of_two_nodes_user_can_access()
Test check for one permission in node list returns true for tree of two nodes user can access
- test_check_for_one_permission_returns_false_when_permissions_is_empty_list()
Test check for one permission returns false when permissions is empty list
- test_check_for_one_permission_returns_false_when_user_does_not_have_perms()
Test check for one permission returns false when suer does not have perms
- test_check_for_one_permission_returns_true_when_user_is_not_su_but_has_perms()
Test check for one permission returns true when user is not su but has perms
- test_check_for_one_permission_returns_true_when_user_is_superuser()
Test check for one permission returns true when user is superuser
- test_check_for_strict_whitelisted_node_returns_false_when_node_not_in_list()
Test check for strict whitelisted node returns false when node not in list
- test_check_for_strict_whitelisted_node_returns_true_when_node_in_list()
Test check for strict whitelisted node returns true when node in list
- test_ensure_node_has_url_property_adds_url_property_from_valid_route()
Test ensure node has url property adds url property from valid route
- test_ensure_node_has_url_property_raises_key_error_when_route_field_missing()
Test ensure node has url property raises KeyError when route field missing
- test_ensure_node_has_url_property_raises_reverse_error_when_route_is_not_valid()
Test ensure node has url property raises reverse error when route is not valid
- test_ensure_node_has_url_property_sets_url_to_a_hash_when_route_is_a_hash()
Test ensure node has url property sets url to a hash when route is a hash
- test_ensure_node_has_url_property_works_when_node_has_url_property_defined()
Test ensure node has url property works when node has url property defined
- test_get_permissions_from_node_pulls_login_required_from_direct_assignment()
Test get permissions from node pulls login_required from direct assignment
- test_get_permissions_from_node_pulls_login_required_from_direct_assignment_when_external_url()
Test get permissions from node pulls login_required from direct assignment_when_external_url
- test_get_permissions_from_node_pulls_login_required_from_view_function()
Test get permissions from node pulls login_required from view function
- test_get_permissions_from_node_pulls_login_required_from_view_with_hash_route_and_valid_url()
Test get permissions from node pull login_required from view with hash route and valid url
- test_get_permissions_from_node_pulls_login_required_value_from_node_over_view_function_when_both_set()
Test get permissions from node pulls login required value from node over view function when both set
- test_get_permissions_from_node_pulls_one_of_permissions_from_direct_assigned_one_of_permissions_when_external_url()
Test get permissions from node pulls one of permissions from direct assigned one of permissions_when_external_url
- test_get_permissions_from_node_pulls_one_of_permissions_from_direct_assigned_permissions()
Test get permissions from node pulls one of permissions from direct assigned permissions
- test_get_permissions_from_node_pulls_one_of_permissions_from_node_over_view_function_when_both_set()
Test get permissions from node pulls one of permissions from node over view function when both set
- test_get_permissions_from_node_pulls_one_of_permissions_from_view_function()
Test get permissions from node pulls one of permissions from view function
- test_get_permissions_from_node_pulls_one_of_permissions_from_view_with_hash_route_and_valid_url()
Test get permissions from node pull one of permissions from view with hash route and valid url
- test_get_permissions_from_node_pulls_permissions_from_direct_assigned_permissions()
Test get permissions from node pulls permissions from direct assigned permissions
- test_get_permissions_from_node_pulls_permissions_from_direct_assigned_permissions_when_external_url()
Test get permissions from node pulls permissions from direct assigned permissions_when_external_url
- test_get_permissions_from_node_pulls_permissions_from_node_over_view_function_when_both_set()
Test get permissions from node pulls permissions from node over view function when both set
- test_get_permissions_from_node_pulls_permissions_from_view_function()
Test get permissions from node pulls permissions from view function
- test_get_permissions_from_node_pulls_permissions_from_view_with_hash_route_and_valid_url()
Test get permissions from node pull permission from view with hash route and valid url
- test_get_permissions_from_node_raises_error_when_route_causes_a_reverse_error()
Test get permissions from node raises error when route causes a reverse error
- test_get_permissions_from_node_raises_keyerror_when_route_is_missing()
Test get permissions from node raises KeyError when route is missing
- test_get_permissions_from_node_returns_empty_list_when_no_reverse_error_and_route_is_a_hash()
Test get permissions from node returns empty list when no reverse error and route is a hash
- test_get_permissions_from_node_returns_false_when_not_set_on_the_node()
Test get permissions from node returns false when not set on the node
- test_get_permissions_from_node_returns_false_when_the_node_is_for_an_external_resource()
Test get permissions from node returns false when the node is for an external resource
- test_get_permissions_from_node_returns_one_of_permission_empty_list_when_there_are_no_defined_permissions_on_the_node()
Test get permissions from node returns one of permission empty list when there are no defined permissions on the node
- test_get_permissions_from_node_returns_one_of_permissions_empty_list_when_the_node_is_for_an_external_resource()
Test get permissions from node returns one of permissions empty list when the node is for an external resource
- test_get_permissions_from_node_returns_permissions_empty_list_when_the_node_is_for_an_external_resource()
Test get permissions from node returns permissions empty list when the node is for an external resource
- test_get_permissions_from_node_returns_permissions_empty_list_when_there_are_no_defined_permissions_on_the_node()
Test get permissions from node returns permissions empty list when there are no defined permissions on the node
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_off_node_login()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_off_node_one_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_off_node_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_login()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_off()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_one_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_off_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_login()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_off()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_one_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_one_perm_login_wl_on()
test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_perm_login_wl_on
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_off_node_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_login()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_login_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_off()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_one_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_one_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_one_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_perm()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_false_when_user_anonymous_login_on_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_off_node_one_perm()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_off_node_perm()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_on_node_off()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_on_node_one_perm()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_on_node_perm()
- test_is_allowed_node_is_false_when_user_staff_login_off_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_off_node_one_perm()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_off_node_one_perm_login_wl_on()
test_is_allowed_node_is_false_when_user_staff_login_on_strict_off_node_perm_login_wl_on
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_off_node_perm()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_off_node_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_one_perm()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_one_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_one_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_perm()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_perm_login_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_login_on_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_false_when_user_staff_perm_login_off_strict_on_node_off()
- test_is_allowed_node_is_true_when_user_anonymous_login_off_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_anonymous_login_off_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_anonymous_login_on_strict_off_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_anonymous_login_on_strict_off_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_anonymous_login_on_strict_on_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_anonymous_login_on_strict_on_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_anonymous_login_on_strict_on_node_off_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_off_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_staff_login_off_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_staff_login_off_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_staff_login_off_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_off_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_off_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_off_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_login_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_off()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_off_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_login_on_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_off_node_one_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_off_node_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_one_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_off_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_one_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_one_perm_login_wl_on()
test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_perm_login_wl_on
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_off_node_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_login_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_off()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_off_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_one_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_one_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_one_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_perm()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_staff_perm_login_on_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_off_node_one_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_off_node_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_off()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_one_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_off_strict_on_node_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_login()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_off()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_one_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_one_perm_login_wl_on()
test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_perm_login_wl_on
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_off_node_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_login()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_login_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_login_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_login_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_off()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_off_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_off_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_off_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_one_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_one_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_one_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_one_perm_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_perm()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_perm_login_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_perm_login_wl_on_strict_wl_on()
- test_is_allowed_node_is_true_when_user_superuser_login_on_strict_on_node_perm_strict_wl_on()
- test_render_link_renders_dynamic_text_via_string_returning_hook_when_user_has_access()
Test render renders dynamic text via hook when user has access
- test_render_link_renders_dynamic_text_via_tuple_returning_hook_when_user_has_access()
Test render link renders dynamic text via tuple returning hook when user has access
- test_render_link_renders_when_user_has_access()
Test render link renders when user has access
- test_render_link_renders_with_no_icon_when_not_specified_and_when_user_has_access()
Test render link renders with no icon when not specified and when user has access
- test_render_menu_renders_when_user_has_access_and_includes_admin_and_menu_first_and_menu_last_when_include_admin_on()
Test render menu renders when user has access and includes admin and menu first and menu last when include admin on
- test_render_menu_renders_when_user_has_access_and_includes_admin_and_menu_first_when_include_admin_on()
Test render menu renders when user has access and includes admin and menu first when include admin on
- test_render_menu_renders_when_user_has_access_and_includes_admin_and_menu_last_when_include_admin_on()
Test render menu renders when user has access and includes admin and menu last when include admin on
- test_render_menu_renders_when_user_has_access_and_includes_admin_when_include_admin_on()
Test render menu renders when user has access and includes admin when include admin on
- test_render_menu_renders_when_user_has_access_but_excludes_admin_when_include_admin_off()
Test render menu renders when user has access but excludes admin when include admin off
- test_render_nodes_renders_when_user_has_access()
Test render nodes renders when user has access
- test_render_section_renders_when_user_has_access()
Test render section renders when user has access
- test_render_tree_renders_when_user_has_access()
Test render tree renders when user has access
- test_render_tree_renders_with_default_icon_when_user_has_access_and_node_lacks_icon()
Test render tree renders with default icon when user has access and node lacks icon
tests.test_views module
Tests for Views
- class tests.test_views.ViewsTestCase(methodName='runTest')
Bases:
TestCase
Test Views
- setUp()
Hook method for setting up the test fixture before exercising it.
- test_404_view_works_when_triggered()
Test 404 view works when triggered
- test_404_view_works_when_triggered_and_followed()
Test 404 view works when triggered
- test_demo_view_returns_correct_template()
Test demo view returns correct template
- test_home_view_returns_correct_template()
Test home view returns correct template
- test_home_view_works_when_not_authenticated()
Test home view works when not authenticated
- test_register_view_returns_correct_template()
Test register view returns correct template
- test_register_view_works_when_not_authenticated()
Test register view works when not authenticated
- test_sample1_view_redirects_to_login_when_authenticated_with_incorrect_permissions()
Test sample1 view redirects to login when authenticated with incorrect permissions
- test_sample1_view_redirects_to_login_when_not_authenticated()
Test sample1 view redirects to login when not authenticated
- test_sample1_view_returns_correct_template()
Test sample1 view returns correct template
- test_sample1_view_works_when_authenticated_with_correct_permissions()
Test sample1 view works when authenticated with correct permissions
- test_sample2_view_redirects_to_login_when_authenticated_with_incorrect_permissions()
Test sample2 view redirects to login when authenticated with incorrect permissions
- test_sample2_view_redirects_to_login_when_not_authenticated()
Test sample2 view redirects to login when not authenticated
- test_sample2_view_returns_correct_template()
Test sample2 view returns correct template
- test_sample2_view_works_when_authenticated_with_correct_permissions()
Test sample2 view works when authenticated with correct permissions
- test_sample_form_view_redirects_to_login_when_not_authenticated()
Test sample_form view redirects to login when not authenticated
- test_sample_form_view_returns_correct_template()
Test sample1 view returns correct template
- test_sample_form_view_works_when_authenticated_with_no_permissions()
Test sample_form view works when authenticated with no permissions
tests.utils module
- tests.utils.valid_string_hook_function(arg1, context, kwarg1='kwarg1')
A valid hook function used in testing
- tests.utils.valid_tuple_hook_function(arg1, context, kwarg1='kwarg1')
A invalid hook function used in testing