Skip to content

Commit f33a5c8

Browse files
pre-commit-ci[bot]Shrikantgiri25
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci Fix TokenObtainPairSerializer to declare access and refresh fields for schema accuracy - Explicitly declare 'access' and 'refresh' fields as read-only - Ensures schema generators (drf-yasg, DRF core) reflect the actual response - No runtime behavior change
1 parent 8196ba0 commit f33a5c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,14 @@ def test_schema_fields_do_not_break_runtime_validation(self):
217217
# Tokens should be valid
218218
access_token = AccessToken(validated_data["access"])
219219
refresh_token = RefreshToken(validated_data["refresh"])
220-
220+
221221
# Validate token type and some claims, but don't assert JTI equality
222222
self.assertEqual(access_token["token_type"], "access")
223223
self.assertEqual(refresh_token["token_type"], "refresh")
224224
self.assertEqual(access_token["user_id"], str(self.user.id))
225225
self.assertEqual(refresh_token["user_id"], str(self.user.id))
226226

227+
227228
class TestTokenRefreshSlidingSerializer(TestCase):
228229
def setUp(self):
229230
self.username = "test_user"

0 commit comments

Comments
 (0)