def test_check_viewset_lookup_field_has_valid_value(definition, expected_errors): node = get_class_def_node_body_from_string_definition(definition) errors = check_viewset_lookup_field_has_valid_value(node) assert errors == expected_errors
def test_check_doctstrings_viewsets_dispatch_methods(definition, expected_errors): node = get_class_def_node_body_from_string_definition(definition) errors = check_doctstrings_viewsets_dispatch_methods(node) assert errors == expected_errors
def test_check_schema_tag_presence(request, definition, file_path_fixture, expected_errors): file_path = request.getfixturevalue(file_path_fixture) node = get_class_def_node_body_from_string_definition(definition) errors = check_schema_tags_presence_in_views_and_viewsets(node, file_path) assert errors == expected_errors
def test_check_schema_wrapper_for_serializer_method_field( request, definition, file_path_fixture, expected_errors, ): file_path = request.getfixturevalue(file_path_fixture) node = get_class_def_node_body_from_string_definition(definition) errors = check_schema_wrapper_for_serializer_method_field(node, file_path) assert errors == expected_errors
def test_help_text_attribute_in_serializer_fields( request, definition, file_path_fixture, expected_errors, ): file_path = request.getfixturevalue(file_path_fixture) node = get_class_def_node_body_from_string_definition(definition) errors = check_help_text_attribute_in_serializer_fields(node, file_path) assert errors == expected_errors
def test_is_view_success_case(definition, expected_result): node = get_class_def_node_body_from_string_definition(definition) result = is_view(node) assert result == expected_result
def test_check_docstrings_for_api_action_handlers(definition, expected_errors): node = get_class_def_node_body_from_string_definition(definition) errors = check_docstrings_for_api_action_handlers(node) assert errors == expected_errors
def test_is_serializer_success_case(definition, expected_result): classdef_node = get_class_def_node_body_from_string_definition(definition) result = is_serializer(classdef_node) assert result == expected_result
def test_check_viewset_has_serializer_class_map(definition, expected_errors): node = get_class_def_node_body_from_string_definition(definition) errors = check_viewset_has_serializer_class_map(node) assert errors == expected_errors
def test_check_docstring_success_case(definition, expected_errors): node = get_class_def_node_body_from_string_definition(definition) errors = check_docstring(node) assert errors == expected_errors