-
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.
Merge pull request #61 from NatLibFi/feature/simplye-354/library-sett…
…ings Inherit settings from default library
- Loading branch information
Showing
7 changed files
with
66 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,25 +306,6 @@ def test_libraries_post_errors( | |
controller.process_post() | ||
assert excinfo.value.problem_detail.uri == INCOMPLETE_CONFIGURATION.uri | ||
|
||
# Either patron support email or website MUST be present | ||
with flask_app_fixture.test_request_context_system_admin("/", method="POST"): | ||
flask.request.form = ImmutableMultiDict( | ||
[ | ||
("name", "Email or Website Library"), | ||
("short_name", "Email or Website"), | ||
("website", "http://example.org"), | ||
("default_notification_email_address", "[email protected]"), | ||
] | ||
) | ||
with pytest.raises(ProblemError) as excinfo: | ||
controller.process_post() | ||
assert excinfo.value.problem_detail.uri == INCOMPLETE_CONFIGURATION.uri | ||
assert excinfo.value.problem_detail.detail is not None | ||
assert ( | ||
"'Patron support email address' or 'Patron support website'" | ||
in excinfo.value.problem_detail.detail | ||
) | ||
|
||
# Test a web primary and secondary color that doesn't contrast | ||
# well on white. Here primary will, secondary should not. | ||
with flask_app_fixture.test_request_context_system_admin("/", method="POST"): | ||
|
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 |
---|---|---|
|
@@ -1087,8 +1087,8 @@ def annotate_authentication_document(library, doc, url_for): | |
library_settings.color_scheme = "plaid" | ||
|
||
# Set the colors a web client should use. | ||
library_settings.web_primary_color = "#012345" | ||
library_settings.web_secondary_color = "#abcdef" | ||
library_settings.web_primary_color = "#000001" | ||
library_settings.web_secondary_color = "#000002" | ||
|
||
# Configure the various ways a patron can get help. | ||
library_settings.help_email = "[email protected]" # type: ignore[assignment] | ||
|
@@ -1165,8 +1165,8 @@ def annotate_authentication_document(library, doc, url_for): | |
|
||
# The mobile color scheme and web colors are correctly reported. | ||
assert "plaid" == doc["color_scheme"] | ||
assert "#012345" == doc["web_color_scheme"]["primary"] | ||
assert "#abcdef" == doc["web_color_scheme"]["secondary"] | ||
assert "#000001" == doc["web_color_scheme"]["primary"] | ||
assert "#000002" == doc["web_color_scheme"]["secondary"] | ||
|
||
# We also need to test that the links got pulled in | ||
# from the configuration. | ||
|
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 |
---|---|---|
|
@@ -1560,12 +1560,12 @@ def test_default_notification_email_address( | |
# Test the ability to get the default notification email address | ||
# for a patron or a library. | ||
settings = library_fixture.mock_settings() | ||
settings.default_notification_email_address = "help@library" # type: ignore[assignment] | ||
settings.default_notification_email_address = "help@example.com" # type: ignore[assignment] | ||
library = library_fixture.library(settings=settings) | ||
patron = db.patron(library=library) | ||
m = BaseCirculationAPI.default_notification_email_address | ||
assert "help@library" == m(library, "") | ||
assert "help@library" == m(patron, "") | ||
assert "help@example.com" == m(library, "") | ||
assert "help@example.com" == m(patron, "") | ||
other_library = library_fixture.library() | ||
assert "[email protected]" == m(other_library, "") | ||
|
||
|
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