Web APIs for Django. 🎸
997 matches across 15 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_utils.py | 87 | def test_resource_root_breadcrumbs(self): |
| LOW | tests/test_utils.py | 93 | def test_resource_instance_breadcrumbs(self): |
| LOW | tests/test_utils.py | 101 | def test_resource_instance_customname_breadcrumbs(self): |
| LOW | tests/test_utils.py | 109 | def test_nested_resource_breadcrumbs(self): |
| LOW | tests/test_utils.py | 118 | def test_nested_resource_instance_breadcrumbs(self): |
| LOW | tests/test_utils.py | 128 | def test_broken_url_breadcrumbs_handled_gracefully(self): |
| LOW | tests/test_utils.py | 132 | def test_modelviewset_resource_instance_breadcrumbs(self): |
| LOW | tests/test_utils.py | 140 | def test_modelviewset_list_action_breadcrumbs(self): |
| LOW | tests/test_utils.py | 148 | def test_modelviewset_detail_action_breadcrumbs(self): |
| LOW | tests/test_utils.py | 157 | def test_modelviewset_action_name_kwarg(self): |
| LOW | tests/test_utils.py | 166 | def test_modelviewset_action_suffix_kwarg(self): |
| LOW | tests/test_utils.py | 207 | def test_valid_unicode_preserved(self): |
| LOW | tests/test_utils.py | 217 | def test_valid_unicode_replaced(self): |
| LOW | tests/test_utils.py | 239 | def test_valid_unicode_removed(self): |
| LOW | tests/test_utils.py | 258 | def test_it_formats_correctly(self): |
| LOW | tests/test_pagination.py | 42 | def test_filtered_items_are_paginated(self): |
| LOW | tests/test_pagination.py | 67 | def test_setting_page_size_over_maximum(self): |
| LOW | tests/test_pagination.py | 85 | def test_setting_page_size_to_zero(self): |
| LOW | tests/test_pagination.py | 99 | def test_additional_query_params_are_preserved(self): |
| LOW | tests/test_pagination.py | 110 | def test_empty_query_params_are_preserved(self): |
| LOW | tests/test_pagination.py | 263 | def test_get_paginated_response_schema(self): |
| LOW | tests/test_pagination.py | 407 | def test_pagination_not_applied_if_limit_or_default_limit_not_set(self): |
| LOW | tests/test_pagination.py | 575 | def test_get_paginated_response_schema(self): |
| LOW | tests/test_pagination.py | 619 | def test_use_with_ordering_filter(self): |
| LOW | tests/test_pagination.py | 637 | def test_use_with_ordering_filter_without_ordering_default_value(self): |
| LOW | tests/test_pagination.py | 724 | def test_cursor_pagination_current_page_empty_forward(self): |
| LOW | tests/test_pagination.py | 747 | def test_cursor_pagination_current_page_empty_reverse(self): |
| LOW | tests/test_pagination.py | 770 | def test_cursor_pagination_with_page_size(self): |
| LOW | tests/test_pagination.py | 782 | def test_cursor_pagination_with_page_size_over_limit(self): |
| LOW | tests/test_pagination.py | 794 | def test_cursor_pagination_with_page_size_zero(self): |
| LOW | tests/test_pagination.py | 861 | def test_cursor_pagination_with_page_size_negative(self): |
| LOW | tests/test_pagination.py | 928 | def test_get_paginated_response_schema(self): |
| LOW | tests/test_pagination.py | 1105 | def test_get_displayed_page_numbers(): |
| LOW | tests/test_relations_slug.py | 57 | def test_foreign_key_retrieve(self): |
| LOW | tests/test_relations_slug.py | 68 | def test_foreign_key_retrieve_select_related(self): |
| LOW | tests/test_relations_slug.py | 74 | def test_reverse_foreign_key_retrieve(self): |
| LOW | tests/test_relations_slug.py | 83 | def test_reverse_foreign_key_retrieve_prefetch_related(self): |
| LOW | tests/test_relations_slug.py | 107 | def test_foreign_key_update_incorrect_type(self): |
| LOW | tests/test_relations_slug.py | 114 | def test_reverse_foreign_key_update(self): |
| LOW | tests/test_relations_slug.py | 161 | def test_reverse_foreign_key_create(self): |
| LOW | tests/test_relations_slug.py | 179 | def test_foreign_key_update_with_invalid_null(self): |
| LOW | tests/test_relations_slug.py | 198 | def test_foreign_key_retrieve_with_null(self): |
| LOW | tests/test_relations_slug.py | 208 | def test_foreign_key_create_with_valid_null(self): |
| LOW | tests/test_relations_slug.py | 227 | def test_foreign_key_create_with_valid_emptystring(self): |
| LOW | tests/test_relations_slug.py | 251 | def test_foreign_key_update_with_valid_null(self): |
| LOW | tests/test_relations_slug.py | 269 | def test_foreign_key_update_with_valid_emptystring(self): |
| LOW | tests/conftest.py | 136 | def pytest_collection_modifyitems(config, items): |
| LOW | tests/test_authtoken.py | 27 | def test_authtoken_can_be_imported_when_not_included_in_installed_apps(self): |
| LOW | tests/test_authtoken.py | 35 | def test_model_admin_displayed_fields(self): |
| LOW | tests/test_authtoken.py | 41 | def test_model_admin__username_field(self, mock_register): |
| LOW | tests/test_authtoken.py | 63 | def test_token_string_representation(self): |
| LOW | tests/test_authtoken.py | 66 | def test_validate_raise_error_if_no_credentials_provided(self): |
| LOW | tests/test_authtoken.py | 70 | def test_whitespace_in_password(self): |
| LOW | tests/test_authtoken.py | 76 | def test_token_creation_collision_raises_integrity_error(self): |
| LOW | tests/test_authtoken.py | 84 | def test_key_generated_on_save_when_cleared(self): |
| LOW | tests/test_authtoken.py | 97 | def test_clearing_key_on_existing_token_raises_integrity_error(self): |
| LOW | tests/test_authtoken.py | 109 | def test_saving_existing_token_without_changes_does_not_alter_key(self): |
| LOW | tests/test_authtoken.py | 122 | def test_command_create_user_token(self): |
| LOW | tests/test_authtoken.py | 128 | def test_command_create_user_token_invalid_user(self): |
| LOW | tests/test_authtoken.py | 132 | def test_command_reset_user_token(self): |
| 832 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| CRITICAL | tests/test_fields.py | 15 | from django.core.exceptions import ValidationError as DjangoValidationError |
| CRITICAL | rest_framework/fields.py | 15 | from django.core.exceptions import ValidationError as DjangoValidationError |
| CRITICAL | rest_framework/validators.py | 9 | from django.core.exceptions import FieldError |
| CRITICAL | rest_framework/serializers.py | 22 | from django.core.exceptions import ValidationError as DjangoValidationError |
| CRITICAL | rest_framework/generics.py | 4 | from django.core.exceptions import ValidationError |
| CRITICAL | rest_framework/authtoken/admin.py | 5 | from django.core.exceptions import ValidationError |
| CRITICAL | …framework/static/rest_framework/js/jquery-3.7.1.min.js | 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):f |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/test_model_serializer.py | 38 | # --------------------------------- |
| MEDIUM | tests/test_model_serializer.py | 521 | # ------------------------------------ |
| MEDIUM | tests/test_serializer.py | 22 | # ------------------------------- |
| MEDIUM | tests/test_serializer.py | 62 | # ----------------------------- |
| MEDIUM | tests/test_validators.py | 22 | # --------------------------- |
| MEDIUM | tests/test_validators.py | 142 | # ----------------------------------- |
| MEDIUM | tests/test_validators.py | 837 | # ---------------------------------- |
| MEDIUM | tests/test_validators.py | 906 | # ---------------------------------- |
| MEDIUM | tests/test_validators.py | 945 | # ---------------------------------- |
| MEDIUM | tests/test_fields.py | 2745 | # -------------------- |
| MEDIUM | tests/test_fields.py | 2762 | # -------------------- |
| MEDIUM | tests/test_fields.py | 33 | # --------------------------- |
| MEDIUM | tests/test_fields.py | 128 | # --------------------------------------------------------- |
| MEDIUM | tests/test_fields.py | 702 | # ---------------------------------------- |
| MEDIUM | tests/test_fields.py | 2777 | # -------------------------------- |
| MEDIUM | tests/test_fields.py | 2803 | # --------------------- |
| MEDIUM | tests/test_fields.py | 2815 | # --------------------------- |
| MEDIUM | rest_framework/serializers.py | 87 | # -------------- |
| MEDIUM | rest_framework/serializers.py | 274 | # ----------------------------------- |
| MEDIUM | rest_framework/serializers.py | 826 | # -------------------------------------------- |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | tests/test_relations_slug.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | tests/test_relations_slug.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | tests/test_relations_hyperlink.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | tests/test_relations_hyperlink.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | tests/test_relations_pk.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | tests/test_relations_pk.py | 0 | the emptystring should be interpreted as null in the context of relationships. |
| HIGH | rest_framework/validators.py | 0 | if an instance is being updated, then do not include that instance itself as a uniqueness conflict. |
| HIGH | rest_framework/validators.py | 0 | if an instance is being updated, then do not include that instance itself as a uniqueness conflict. |
| HIGH | rest_framework/validators.py | 0 | if an instance is being updated, then do not include that instance itself as a uniqueness conflict. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_views.py | 28 | |
| LOW | rest_framework/compat.py | 164 | |
| LOW | rest_framework/compat.py | 174 | |
| LOW | rest_framework/fields.py | 166 | |
| LOW | rest_framework/fields.py | 700 | |
| LOW | rest_framework/fields.py | 837 | |
| LOW | rest_framework/fields.py | 1198 | |
| LOW | rest_framework/fields.py | 1253 | |
| LOW | rest_framework/fields.py | 1319 | |
| LOW | rest_framework/serializers.py | 1257 | |
| LOW | rest_framework/serializers.py | 1455 | |
| LOW | rest_framework/serializers.py | 1472 | |
| LOW | rest_framework/renderers.py | 179 | |
| LOW | rest_framework/renderers.py | 558 | |
| LOW | rest_framework/routers.py | 266 | |
| LOW | rest_framework/filters.py | 20 | |
| LOW | rest_framework/filters.py | 83 | |
| LOW | rest_framework/filters.py | 111 | |
| LOW | rest_framework/negotiation.py | 35 | |
| LOW | rest_framework/templatetags/rest_framework.py | 182 | |
| LOW | rest_framework/utils/encoders.py | 23 | |
| LOW | rest_framework/utils/representation.py | 70 | |
| LOW | rest_framework/schemas/openapi.py | 215 | |
| LOW | rest_framework/schemas/openapi.py | 269 | |
| LOW | rest_framework/schemas/openapi.py | 338 | |
| LOW | rest_framework/schemas/openapi.py | 552 | |
| LOW | rest_framework/schemas/generators.py | 72 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/conftest.py | 110 | |
| LOW | tests/importable/__init__.py | 6 | |
| LOW | rest_framework/compat.py | 149 | |
| LOW | rest_framework/serializers.py | 55 | |
| LOW | rest_framework/serializers.py | 55 | |
| LOW | rest_framework/serializers.py | 55 | |
| LOW | rest_framework/serializers.py | 55 | |
| LOW | rest_framework/serializers.py | 62 | |
| LOW | rest_framework/serializers.py | 62 | |
| LOW | rest_framework/serializers.py | 62 | |
| LOW | rest_framework/serializers.py | 68 | |
| LOW | rest_framework/serializers.py | 71 | |
| LOW | rest_framework/apps.py | 10 | |
| LOW | rest_framework/schemas/__init__.py | 25 | |
| LOW | rest_framework/schemas/__init__.py | 26 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/test_authtoken.py | 85 | # Create a new user for this test to avoid conflicts with setUp token |
| MEDIUM | tests/test_authtoken.py | 88 | # Create a token without a key - it should generate one automatically |
| MEDIUM | tests/test_model_serializer.py | 859 | # Creating the instance, relationship attributes should be set. |
| MEDIUM | tests/test_model_serializer.py | 907 | # Creating the instance, relationship attributes should be set. |
| MEDIUM | rest_framework/serializers.py | 1141 | # Create the serializer field. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_urlpatterns.py | 27 | except Exception: |
| LOW | tests/test_urlpatterns.py | 43 | except Exception: |
| LOW | rest_framework/fields.py | 1187 | except Exception as e: |
| LOW | rest_framework/request.py | 360 | except Exception: |
| LOW | rest_framework/renderers.py | 199 | except Exception: |
| LOW | rest_framework/views.py | 317 | except Exception: |
| LOW | rest_framework/views.py | 514 | except Exception as exc: |
| LOW | rest_framework/utils/breadcrumbs.py | 19 | except Exception: |
| LOW | rest_framework/schemas/openapi.py | 284 | except Exception: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | tests/test_fields.py | 2729 | (b'{"a": 1, "3": null, "b": ["some", "list", true, 1.23]}', { |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | docs/tutorial/2-requests-and-responses.md | 20 | return Response(data) # Renders to content type as requested by the client. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | README.md | 132 | "email": "admin@example.com", |
| LOW | tests/schemas/test_openapi.py | 1065 | assert properties['email']['default'] == 'foo@bar.com' |
| LOW | tests/schemas/views.py | 131 | email = serializers.EmailField(default='foo@bar.com') |
| LOW | docs/tutorial/quickstart.md | 229 | "email": "admin@example.com", |
| LOW | docs/tutorial/quickstart.md | 249 | "email": "admin@example.com", |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | rest_framework/settings.py | 222 | # Check if present in user settings |
| LOW | rest_framework/decorators.py | 94 | # Check if func is actually a view function (result of APIView.as_view()) |
| LOW | rest_framework/utils/breadcrumbs.py | 22 | # Check if this is a REST framework view, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | rest_framework/serializers.py | 1643 | # Note that we make sure to check `unique_together` both on the |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | rest_framework/serializers.py | 881 | # ... |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_fields.py | 70 | def test_function(self): |