-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small structural refactor, fix factory imports, update Docs
- Loading branch information
1 parent
bdaabbe
commit 43fa69b
Showing
9 changed files
with
96 additions
and
62 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
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from functional_tests.step_helpers.factories import TEST_USER_PASSWORD, UserFactory | ||
|
||
|
||
def create_cms_admin_user() -> tuple[str, str]: | ||
"""Creates a CMS admin user using a factory, returns the username and password.""" | ||
user = UserFactory() | ||
return user.username, TEST_USER_PASSWORD |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
def str_to_bool(bool_string: str) -> bool: | ||
"""Takes a string argument which indicates a boolean, and returns the corresponding boolean value. | ||
raises ValueError if input string is not one of the recognized boolean like values. | ||
""" | ||
if bool_string.lower() in ("yes", "true", "t", "y", "1"): | ||
return True | ||
if bool_string.lower() in ("no", "false", "f", "n", "0"): | ||
return False | ||
raise ValueError(f"Invalid input: {bool_string}") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
from behave import given # pylint: disable=E0611 | ||
from behave.runner import Context | ||
|
||
from functional_tests.step_helpers.factories import ContactDetailsFactory | ||
|
||
|
||
@given("a contact details snippet exists") | ||
def create_contact_details_snippet(context: Context): | ||
"""Create a contact details snippet.""" | ||
# TODO this import fails at the top level with error: pylint: disable=W0511 | ||
# "django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet." | ||
# Find a better solution | ||
from functional_tests.factories import ContactDetailsFactory # pylint: disable=C0415 | ||
|
||
context.contact_details_snippet = ContactDetailsFactory() |