Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1993,15 +1993,10 @@ def setUpClass(cls):
"""Sets up a WorkbenchConfig object with a temporary config file for testing and a patch to
handle calls to verify the 'host' URL."""
cls.get_patcher = mock.patch(
"WorkbenchConfig.requests.sessions.Session.get",
"WorkbenchConfig.requests.sessions.Session.request",
side_effect=mocked_requests_get,
)
cls.get_patcher.start()
cls.head_patcher = mock.patch(
"WorkbenchConfig.requests.sessions.Session.head",
side_effect=mocked_requests_get,
)
cls.head_patcher.start()

with tempfile.NamedTemporaryFile(
mode="w+", delete=False, suffix=".yml"
Expand All @@ -2021,7 +2016,6 @@ def setUpClass(cls):
def tearDownClass(cls):
"""Stops the patcher and removes the temporary config file."""
cls.get_patcher.stop()
cls.head_patcher.stop()
if os.path.exists(cls.config_file_name):
os.remove(cls.config_file_name)

Expand Down
4 changes: 2 additions & 2 deletions workbench
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def create():
print("Warning: " + message)

# Add custom (non-required) CSV fields.
entity_fields = get_entity_fields(config, "node", config["content_type"])
entity_fields = get_entity_fields(config, "node", config["content_type"]).keys()
# Only add config['id_field'] to required_fields if it is not a node field.
required_fields = ["file", "title"]
if config["id_field"] not in entity_fields:
Expand Down Expand Up @@ -2277,7 +2277,7 @@ def create_from_files():
}

# Add field_model if that field exists in the current content type.
entity_fields = get_entity_fields(config, "node", config["content_type"])
entity_fields = get_entity_fields(config, "node", config["content_type"]).keys()
if "field_model" in entity_fields:
islandora_model = set_model_from_extension(file_name, config)
node_json["field_model"] = [
Expand Down
Loading
Loading