-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#485] Add validate_no_empty for identifier
- Loading branch information
1 parent
80c5b0e
commit 51da707
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,3 +363,25 @@ def test_invalid_setup_identifier(self): | |
execute_single_step(TokenAuthConfigurationStep, object_source=object_source) | ||
self.assertTrue("String should match pattern" in str(command_error.exception)) | ||
self.assertEqual(TokenAuth.objects.count(), 0) | ||
|
||
def test_invalid_empty_identifier(self): | ||
object_source = { | ||
"tokenauth_config_enable": True, | ||
"tokenauth": { | ||
"items": [ | ||
{ | ||
"identifier": "", | ||
"token": "ba9d233e95e04c4a8a661a27daffe7c9bd019067", | ||
"contact_person": "Person 1", | ||
"email": "[email protected]", | ||
"organization": "Organization 1", | ||
"application": "Application 1", | ||
"administration": "Administration 1", | ||
}, | ||
], | ||
}, | ||
} | ||
with self.assertRaises(PrerequisiteFailed) as command_error: | ||
execute_single_step(TokenAuthConfigurationStep, object_source=object_source) | ||
self.assertTrue("String should match pattern" in str(command_error.exception)) | ||
self.assertEqual(TokenAuth.objects.count(), 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters