Skip to content

Commit

Permalink
merge decorators in tests for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwojcik committed Jun 7, 2024
1 parent 8d92865 commit e92863f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions testproject/testapp/tests/test_token_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ def test_post_should_login_user(self):
@override_settings(
AUTHENTICATION_BACKENDS=[
"django.contrib.auth.backends.ModelBackend",
]
)
@override_settings(
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "username"})
],
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "username"}),
)
def test_login__LOGIN_FIELD_username__USERNAME_FIELD_username(
self,
Expand Down Expand Up @@ -97,9 +95,9 @@ def test_login__LOGIN_FIELD_username__USERNAME_FIELD_username(
@override_settings(
AUTHENTICATION_BACKENDS=[
"django.contrib.auth.backends.ModelBackend",
]
],
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "email"}),
)
@override_settings(DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "email"}))
def test_login__LOGIN_FIELD_email__USERNAME_FIELD_username(
self,
):
Expand Down Expand Up @@ -149,10 +147,8 @@ def test_login__LOGIN_FIELD_email__USERNAME_FIELD_username(
@override_settings(
AUTHENTICATION_BACKENDS=[
"django.contrib.auth.backends.ModelBackend",
]
)
@override_settings(
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "username"})
],
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "username"}),
)
def test_login__LOGIN_FIELD_username__USERNAME_FIELD_email(
self,
Expand Down Expand Up @@ -203,9 +199,9 @@ def test_login__LOGIN_FIELD_username__USERNAME_FIELD_email(
@override_settings(
AUTHENTICATION_BACKENDS=[
"django.contrib.auth.backends.ModelBackend",
]
],
DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "email"}),
)
@override_settings(DJOSER=dict(django_settings.DJOSER, **{"LOGIN_FIELD": "email"}))
def test_login__LOGIN_FIELD_email__USERNAME_FIELD_email(
self,
):
Expand Down

0 comments on commit e92863f

Please sign in to comment.