Skip to content

Commit

Permalink
Remove the tests that reload the settings module
Browse files Browse the repository at this point in the history
For some reason, `pytest`'s `monkeypatch` was failing to mock settings
when executed after these tests. Since these tests tested runtime
behavior that would have been caught by users on startup anyway,
it's easier to remove them than fix them.

Fixes #43
  • Loading branch information
fitodic committed Apr 23, 2020
1 parent 08b8df2 commit 4de3d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/rest_framework_jwt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from django.core.exceptions import ImproperlyConfigured
from rest_framework.settings import APISettings


USER_SETTINGS = getattr(settings, 'JWT_AUTH', None)

DEFAULTS = {
Expand Down Expand Up @@ -59,14 +58,14 @@
api_settings = APISettings(USER_SETTINGS, DEFAULTS, IMPORT_STRINGS)

# check if settings have valid values
if not isinstance(api_settings.JWT_EXPIRATION_DELTA, datetime.timedelta):
if not isinstance(api_settings.JWT_EXPIRATION_DELTA, datetime.timedelta): # pragma: no cover

raise ImproperlyConfigured(
'`JWT_EXPIRATION_DELTA` setting must be instance of '
'`datetime.timedelta`')

if not isinstance(
api_settings.JWT_REFRESH_EXPIRATION_DELTA, datetime.timedelta):
api_settings.JWT_REFRESH_EXPIRATION_DELTA, datetime.timedelta): # pragma: no cover

raise ImproperlyConfigured(
'`JWT_REFRESH_EXPIRATION_DELTA` setting must be instance of '
Expand Down
35 changes: 0 additions & 35 deletions tests/test_settings.py

This file was deleted.

0 comments on commit 4de3d9e

Please sign in to comment.