Skip to content

Commit

Permalink
[#486] Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Dec 17, 2024
1 parent cb4bee2 commit f60872b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/objects/setup_configuration/steps/token_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ def execute(self, model: TokenAuthGroupConfigurationModel) -> None:
if key != "identifier"
},
)

self._configure_permissions(token, item.permissions)

except IntegrityError as exception:

raise ConfigurationRunFailed(
"Failed configuring token %s" % token.identifier
"Failed configuring token %s" % item.identifier
) from exception

logger.info("Configured %s", item.identifier)
13 changes: 8 additions & 5 deletions src/objects/setup_configuration/tests/test_token_auth_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def test_invalid_setup_email(self):
execute_single_step(TokenAuthConfigurationStep, object_source=object_source)

self.assertTrue(
"Validation error(s) occured for token-1" in str(command_error.exception)
"Validation error(s) during instance cleaning"
in str(command_error.exception)
)
self.assertEqual(TokenAuth.objects.count(), 0)

Expand All @@ -232,7 +233,8 @@ def test_invalid_setup_token(self):
execute_single_step(TokenAuthConfigurationStep, object_source=object_source)

self.assertTrue(
"Validation error(s) occured for token-1" in str(command_error.exception)
"Validation error(s) during instance cleaning"
in str(command_error.exception)
)
self.assertEqual(TokenAuth.objects.count(), 0)

Expand All @@ -255,9 +257,9 @@ def test_invalid_empty_token(self):
}
with self.assertRaises(ConfigurationRunFailed) as command_error:
execute_single_step(TokenAuthConfigurationStep, object_source=object_source)

self.assertTrue(
"Validation error(s) occured for token-1" in str(command_error.exception)
"Validation error(s) during instance cleaning"
in str(command_error.exception)
)
self.assertEqual(TokenAuth.objects.count(), 0)

Expand Down Expand Up @@ -338,7 +340,8 @@ def test_invalid_setup_contact_person(self):
execute_single_step(TokenAuthConfigurationStep, object_source=object_source)

self.assertTrue(
"Validation error(s) occured for token-1" in str(command_error.exception)
"Validation error(s) during instance cleaning"
in str(command_error.exception)
)
self.assertEqual(TokenAuth.objects.count(), 0)

Expand Down

0 comments on commit f60872b

Please sign in to comment.