Skip to content

Commit

Permalink
[maykinmedia/objects-api#480] Use execute_single_step
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Dec 11, 2024
1 parent 8206383 commit 1b9388d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/objecttypes/setup_configuration/tests/test_oidc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.test import TestCase

from django_setup_configuration.exceptions import ConfigurationException
from django_setup_configuration.test_utils import build_step_config_from_sources
from django_setup_configuration.test_utils import execute_single_step
from mozilla_django_oidc_db.models import OpenIDConnectConfig
from mozilla_django_oidc_db.setup_configuration.steps import AdminOIDCConfigurationStep

Expand All @@ -19,12 +19,10 @@ def test_valid_setup_default(self):
config = OpenIDConnectConfig.get_solo()
self.assertFalse(config.enabled)

setup_config = build_step_config_from_sources(
execute_single_step(
AdminOIDCConfigurationStep,
str(DIR_FILES / "valid_setup.yaml"),
yaml_source=str(DIR_FILES / "valid_setup.yaml"),
)
step = AdminOIDCConfigurationStep()
step.execute(setup_config)

config = OpenIDConnectConfig.get_solo()

Expand All @@ -50,12 +48,10 @@ def test_invalid_setup_default(self):
self.assertFalse(config.enabled)

with self.assertRaises(ConfigurationException) as command_error:
setup_config = build_step_config_from_sources(
execute_single_step(
AdminOIDCConfigurationStep,
str(DIR_FILES / "invalid_setup.yaml"),
yaml_source=str(DIR_FILES / "invalid_setup.yaml"),
)
step = AdminOIDCConfigurationStep()
step.execute(setup_config)

self.assertTrue(
"Input should be a valid string" in str(command_error.exception)
Expand Down

0 comments on commit 1b9388d

Please sign in to comment.