After merging the respective pull request, the tests on CI instance are failing:
apps/questionnaire/tests/test_api.py is now failing,
I guess you have to adapt those tests.
Do you have access to shippable.com?
If you need to see more, you should run the tests on your own instance.
Here is the log of the three failed tests from shippable.com:
self = <apps.questionnaire.tests.test_api.QuestionnaireListViewTest testMethod=test_api_url_detail_v1>
def test_api_url_detail_v1(self):
items = [{'code': 'spam', 'configuration': 'sample'}]
> updated = list(self.view.filter_dict(items))
apps/questionnaire/tests/test_api.py:147:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <questionnaire.api.views.QuestionnaireListView object at 0x7f5670dd95f8>
items = [{'code': 'spam', 'configuration': 'sample'}]
def filter_dict(self, items: dict):
"""
Starting with API v2 only name and url to the detail page are displayed.
"""
for item in items:
yield {
'name': item.get('name'),
'created': item.get('created'),
'updated': item.get('updated'),
> 'compiler': item.get('compilers')[0]['name'],
'reviewer': [reviewers['name'] for reviewers in item.get('reviewers')],
'code': item.get('code'),
'edition': item.get('serializer_edition'),
'url': reverse(
viewname='{configuration}:questionnaire_details'.format(
configuration=item['configuration']
),
kwargs={'identifier': item['code']}),
'translations': item.get('translations'),
'details': reverse(
'{api_version}:questionnaires-api-detail'.format(
api_version=self.request.version
), kwargs={'identifier': item['code']}
),
}
E TypeError: 'NoneType' object is not subscriptable
apps/questionnaire/api/views.py:106: TypeError
pytest / apps.questionnaire.tests.test_api.QuestionnaireListViewTest / test_api_url_detail_v2
: TypeError: 'NoneType' object is not subscriptable
self = <apps.questionnaire.tests.test_api.QuestionnaireListViewTest testMethod=test_api_url_detail_v2>
def test_api_url_detail_v2(self):
items = [{'code': 'spam', 'configuration': 'sample'}]
request = self.request
request.version = 'v2'
view = self.setup_view(self.view, request)
> updated = list(view.filter_dict(items))
apps/questionnaire/tests/test_api.py:157:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <questionnaire.api.views.QuestionnaireListView object at 0x7f5670570160>
items = [{'code': 'spam', 'configuration': 'sample'}]
def filter_dict(self, items: dict):
"""
Starting with API v2 only name and url to the detail page are displayed.
"""
for item in items:
yield {
'name': item.get('name'),
'created': item.get('created'),
'updated': item.get('updated'),
> 'compiler': item.get('compilers')[0]['name'],
'reviewer': [reviewers['name'] for reviewers in item.get('reviewers')],
'code': item.get('code'),
'edition': item.get('serializer_edition'),
'url': reverse(
viewname='{configuration}:questionnaire_details'.format(
configuration=item['configuration']
),
kwargs={'identifier': item['code']}),
'translations': item.get('translations'),
'details': reverse(
'{api_version}:questionnaires-api-detail'.format(
api_version=self.request.version
), kwargs={'identifier': item['code']}
),
}
E TypeError: 'NoneType' object is not subscriptable
apps/questionnaire/api/views.py:106: TypeError
pytest / apps.questionnaire.tests.test_api.QuestionnaireListViewTest / test_api_v2_language_aware
: TypeError: 'NoneType' object is not subscriptable
self = <apps.questionnaire.tests.test_api.QuestionnaireListViewTest testMethod=test_api_v2_language_aware>
mock_reverse = <MagicMock name='reverse' id='140009211050920'>
@patch('questionnaire.api.views.reverse')
def test_api_v2_language_aware(self, mock_reverse):
items = [{'code': 'spam', 'configuration': 'sample'}]
request = self.request
request.version = 'v2'
view = self.setup_view(self.view, request)
> list(view.filter_dict(items))
apps/questionnaire/tests/test_api.py:168:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <questionnaire.api.views.QuestionnaireListView object at 0x7f56704c7358>
items = [{'code': 'spam', 'configuration': 'sample'}]
def filter_dict(self, items: dict):
"""
Starting with API v2 only name and url to the detail page are displayed.
"""
for item in items:
yield {
'name': item.get('name'),
'created': item.get('created'),
'updated': item.get('updated'),
> 'compiler': item.get('compilers')[0]['name'],
'reviewer': [reviewers['name'] for reviewers in item.get('reviewers')],
'code': item.get('code'),
'edition': item.get('serializer_edition'),
'url': reverse(
viewname='{configuration}:questionnaire_details'.format(
configuration=item['configuration']
),
kwargs={'identifier': item['code']}),
'translations': item.get('translations'),
'details': reverse(
'{api_version}:questionnaires-api-detail'.format(
api_version=self.request.version
), kwargs={'identifier': item['code']}
),
}
E TypeError: 'NoneType' object is not subscriptable
apps/questionnaire/api/views.py:106: TypeError