Skip to content
Merged
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
14 changes: 7 additions & 7 deletions contentcuration/contentcuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,14 +1490,14 @@ def get_details(self, channel_id=None):
"resource_size": 0,
"includes": {"coach_content": 0, "exercises": 0},
"kind_count": [],
"languages": "",
"accessible_languages": "",
"licenses": "",
"languages": [],
"accessible_languages": [],
"licenses": [],
"tags": [],
"copyright_holders": "",
"authors": "",
"aggregators": "",
"providers": "",
"copyright_holders": [],
"authors": [],
"aggregators": [],
"providers": [],
"sample_pathway": [],
"original_channels": [],
"sample_nodes": [],
Expand Down
3 changes: 0 additions & 3 deletions contentcuration/contentcuration/not_production_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import logging

from .settings import * # noqa

ALLOWED_HOSTS = ["studio.local", "192.168.31.9", "127.0.0.1", "*"]
Expand All @@ -10,7 +8,6 @@
POSTMARK_TEST_MODE = True

SITE_ID = 2
logging.basicConfig(level="INFO")

# Allow the debug() context processor to add variables to template context.
# Include here the IPs from which a local dev server might be accessed. See
Expand Down
13 changes: 9 additions & 4 deletions contentcuration/contentcuration/tests/test_contentnodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,15 @@ def test_get_node_details(self):
assert details["resource_count"] > 0
assert details["resource_size"] > 0
assert len(details["kind_count"]) > 0
assert len(details["authors"]) == len([author for author in details["authors"] if author])
assert len(details["aggregators"]) == len([aggregator for aggregator in details["aggregators"] if aggregator])
assert len(details["providers"]) == len([provider for provider in details["providers"] if provider])
assert len(details["copyright_holders"]) == len([holder for holder in details["copyright_holders"] if holder])

# assert format of list fields, including that they do not contain invalid data
list_fields = [
"kind_count", "languages", "accessible_languages", "licenses", "tags", "original_channels",
"authors", "aggregators", "providers", "copyright_holders"
]
for field in list_fields:
self.assertIsInstance(details.get(field), list, f"Field '{field}' isn't a list")
self.assertEqual(len(details[field]), len([value for value in details[field] if value]), f"List field '{field}' has falsy values")


class NodeOperationsTestCase(StudioTestCase):
Expand Down