Commit c41456c5 by Matthew Piatetsky

Fix publishing of programs to marketing site

ECOM-6765
parent 7b0ac593
...@@ -117,7 +117,7 @@ class MarketingSitePublisher(object): ...@@ -117,7 +117,7 @@ class MarketingSitePublisher(object):
def _get_node_data(self, program, user_id): def _get_node_data(self, program, user_id):
return { return {
'type': str(program.type).lower(), 'type': str(program.type).lower().replace(' ', '_'),
'title': program.title, 'title': program.title,
'field_uuid': str(program.uuid), 'field_uuid': str(program.uuid),
'uuid': str(program.uuid), 'uuid': str(program.uuid),
...@@ -132,6 +132,7 @@ class MarketingSitePublisher(object): ...@@ -132,6 +132,7 @@ class MarketingSitePublisher(object):
response = api_client.api_session.get(node_url) response = api_client.api_session.get(node_url)
if response.status_code == 200: if response.status_code == 200:
list_item = response.json().get('list') list_item = response.json().get('list')
if list_item:
return list_item[0]['nid'] return list_item[0]['nid']
def _edit_node(self, api_client, node_id, node_data): def _edit_node(self, api_client, node_id, node_data):
......
...@@ -101,14 +101,14 @@ class MarketingSitePublisherTestMixin(MarketingSiteAPIClientTestMixin): ...@@ -101,14 +101,14 @@ class MarketingSitePublisherTestMixin(MarketingSiteAPIClientTestMixin):
def mock_node_retrieval(self, program_uuid, exists=True): def mock_node_retrieval(self, program_uuid, exists=True):
data = {} data = {}
status = 404 status = 200
if exists:
data = { data = {
'list': [{ 'list': []
}
if exists:
data['list'] = [{
'nid': self.node_id 'nid': self.node_id
}] }]
}
status = 200
responses.add( responses.add(
responses.GET, responses.GET,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment