Skip to content

Commit

Permalink
Merge pull request #1337 from tfranzel/fix_rest_auth
Browse files Browse the repository at this point in the history
fix tests for dj_rest_auth changes
  • Loading branch information
tfranzel authored Nov 27, 2024
2 parents 27ae6f2 + bff8d6a commit fbebedb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 121 deletions.
4 changes: 3 additions & 1 deletion tests/contrib/test_rest_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

transforms = [
# User model first_name differences
lambda x: re.sub(r'(first_name:\n *type: string\n *maxLength:) 30', r'\g<1> 150', x, re.M),
lambda x: re.sub(r'(first_name:\n *type: string\n *maxLength:) 30', r'\g<1> 150', x),
# Ignore descriptions as it varies too much between versions
lambda x: re.sub(r'description: \|-\n[\S\s\r\n]+?tags:', r'tags:', x),
]


Expand Down
57 changes: 0 additions & 57 deletions tests/contrib/test_rest_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ paths:
/rest-auth/login/:
post:
operationId: rest_auth_login_create
description: |-
Check the credentials and return the REST Token
if the credentials are valid and authenticated.
Calls Django Auth login method to register User ID
in Django session framework
Accept the following POST parameters: username, password
Return the REST Framework Token Object's key.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -42,11 +34,6 @@ paths:
/rest-auth/logout/:
post:
operationId: rest_auth_logout_create
description: |-
Calls Django logout method and delete the Token object
assigned to the current User object.
Accepts/Returns nothing.
tags:
- rest-auth
security:
Expand All @@ -63,11 +50,6 @@ paths:
/rest-auth/password/change/:
post:
operationId: rest_auth_password_change_create
description: |-
Calls Django Auth SetPasswordForm save method.
Accepts the following POST parameters: new_password1, new_password2
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -95,11 +77,6 @@ paths:
/rest-auth/password/reset/:
post:
operationId: rest_auth_password_reset_create
description: |-
Calls Django Auth PasswordResetForm save method.
Accepts the following POST parameters: email
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -128,13 +105,6 @@ paths:
/rest-auth/password/reset/confirm/:
post:
operationId: rest_auth_password_reset_confirm_create
description: |-
Password reset e-mail link is confirmed, therefore
this resets the user's password.
Accepts the following POST parameters: token, uid,
new_password1, new_password2
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -246,15 +216,6 @@ paths:
/rest-auth/user/:
get:
operationId: rest_auth_user_retrieve
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
security:
Expand All @@ -269,15 +230,6 @@ paths:
description: ''
put:
operationId: rest_auth_user_update
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
requestBody:
Expand All @@ -304,15 +256,6 @@ paths:
description: ''
patch:
operationId: rest_auth_user_partial_update
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
requestBody:
Expand Down
63 changes: 0 additions & 63 deletions tests/contrib/test_rest_auth_token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ paths:
/rest-auth/login/:
post:
operationId: rest_auth_login_create
description: |-
Check the credentials and return the REST Token
if the credentials are valid and authenticated.
Calls Django Auth login method to register User ID
in Django session framework
Accept the following POST parameters: username, password
Return the REST Framework Token Object's key.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -42,11 +34,6 @@ paths:
/rest-auth/logout/:
post:
operationId: rest_auth_logout_create
description: |-
Calls Django logout method and delete the Token object
assigned to the current User object.
Accepts/Returns nothing.
tags:
- rest-auth
security:
Expand All @@ -63,11 +50,6 @@ paths:
/rest-auth/password/change/:
post:
operationId: rest_auth_password_change_create
description: |-
Calls Django Auth SetPasswordForm save method.
Accepts the following POST parameters: new_password1, new_password2
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -95,11 +77,6 @@ paths:
/rest-auth/password/reset/:
post:
operationId: rest_auth_password_reset_create
description: |-
Calls Django Auth PasswordResetForm save method.
Accepts the following POST parameters: email
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -128,13 +105,6 @@ paths:
/rest-auth/password/reset/confirm/:
post:
operationId: rest_auth_password_reset_confirm_create
description: |-
Password reset e-mail link is confirmed, therefore
this resets the user's password.
Accepts the following POST parameters: token, uid,
new_password1, new_password2
Returns the success/fail message.
tags:
- rest-auth
requestBody:
Expand Down Expand Up @@ -246,9 +216,6 @@ paths:
/rest-auth/token/refresh/:
post:
operationId: rest_auth_token_refresh_create
description: |-
Takes a refresh type JSON web token and returns an access type JSON web
token if the refresh token is valid.
tags:
- rest-auth
requestBody:
Expand All @@ -273,9 +240,6 @@ paths:
/rest-auth/token/verify/:
post:
operationId: rest_auth_token_verify_create
description: |-
Takes a token and indicates if it is valid. This view provides no
information about a token's fitness for a particular use.
tags:
- rest-auth
requestBody:
Expand All @@ -300,15 +264,6 @@ paths:
/rest-auth/user/:
get:
operationId: rest_auth_user_retrieve
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
security:
Expand All @@ -323,15 +278,6 @@ paths:
description: ''
put:
operationId: rest_auth_user_update
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
requestBody:
Expand All @@ -358,15 +304,6 @@ paths:
description: ''
patch:
operationId: rest_auth_user_partial_update
description: |-
Reads and updates UserModel fields
Accepts GET, PUT, PATCH methods.
Default accepted fields: username, first_name, last_name
Default display fields: pk, username, email, first_name, last_name
Read-only fields: pk, email
Returns UserModel fields.
tags:
- rest-auth
requestBody:
Expand Down

0 comments on commit fbebedb

Please sign in to comment.