tests: add dataviz null visualization (#48865)
This commit is contained in:
parent
4f878ac96a
commit
b615b7fa99
|
@ -119,6 +119,12 @@ VISUALIZATION_JSON = [
|
|||
'name': 'eleventh visualization (not found)',
|
||||
'slug': 'eleventh',
|
||||
},
|
||||
{
|
||||
'data-url': 'https://bijoe.example.com/visualization/12/json/',
|
||||
'path': 'https://bijoe.example.com/visualization/12/iframe/?signature=123',
|
||||
'name': 'twelth visualization (all null)',
|
||||
'slug': 'twelth',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
@ -217,6 +223,14 @@ def bijoe_mock(url, request):
|
|||
'detail': 'not found',
|
||||
}
|
||||
return {'content': json.dumps(response), 'request': request, 'status_code': 404}
|
||||
if url.path == '/visualization/12/json/':
|
||||
response = {
|
||||
'format': '1',
|
||||
'data': [None, None],
|
||||
'axis': {'x_labels': ['web', 'mail']},
|
||||
'measure': 'integer',
|
||||
}
|
||||
return {'content': json.dumps(response), 'request': request, 'status_code': 200}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -423,6 +437,13 @@ def test_chartng_cell_hide_null_values(app, statistics):
|
|||
([122, 114, 2, 33], {'title': u'bar'}),
|
||||
]
|
||||
|
||||
# all null
|
||||
cell.statistic = Statistic.objects.get(slug='twelth')
|
||||
cell.save()
|
||||
chart = cell.get_chart()
|
||||
assert chart.x_labels == []
|
||||
assert chart.raw_series == [([], {'title': ''})]
|
||||
|
||||
|
||||
@with_httmock(bijoe_mock)
|
||||
def test_chartng_cell_sort_order_alpha(app, statistics):
|
||||
|
|
Loading…
Reference in New Issue