Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed May 13, 2024
1 parent 16d0acf commit 5d1262d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
from django.test import override_settings

from django_opfield.conf import OPFIELD_SETTINGS_NAME
from django_opfield.conf import _get_user_setting
from django_opfield.conf import app_settings


class TestGetUserSettings:
def test_not_set(self):
assert app_settings._get_user_settings("TEST_SETTING") is None
assert _get_user_setting("TEST_SETTING") is None

@override_settings(**{OPFIELD_SETTINGS_NAME: {"TEST_SETTING": "test value"}})
def test_set_in_settings(self):
assert app_settings._get_user_settings("TEST_SETTING") == "test value"
assert _get_user_setting("TEST_SETTING") == "test value"

@patch.dict(os.environ, {"TEST_SETTING": "test value"})
def test_set_in_env(self):
assert app_settings._get_user_settings("TEST_SETTING") == "test value"
assert _get_user_setting("TEST_SETTING") == "test value"


@patch.dict(os.environ, {"OP_CLI_PATH": ""})
Expand Down

0 comments on commit 5d1262d

Please sign in to comment.