tests: remove dataviz migration test (#50845)

This commit is contained in:
Valentin Deniaud 2021-02-04 10:14:35 +01:00
parent 94e666f92c
commit d0fc3f581c
1 changed files with 0 additions and 45 deletions

View File

@ -1142,51 +1142,6 @@ def test_dataviz_import_cell():
assert cell.statistic.service_slug == statistic.service_slug
def test_dataviz_cell_migration(settings):
settings.KNOWN_SERVICES = {
"bijoe": {
"plop": {"title": "test", "url": "https://bijoe.example.com", "secret": "combo", "orig": "combo"}
}
}
page = Page.objects.create(title='One', slug='index')
app = 'dataviz'
migrate_from = [(app, '0012_auto_20201126_1557')]
migrate_to = [(app, '0013_update_chartng_cells')]
executor = MigrationExecutor(connection)
old_apps = executor.loader.project_state(migrate_from).apps
executor.migrate(migrate_from)
Pagee = old_apps.get_model('data', 'Page')
page = Pagee.objects.get(pk=page.pk)
ChartNgCell = old_apps.get_model(app, 'ChartNgCell')
cell = ChartNgCell.objects.create(
page=page,
order=1,
data_reference='plop:example',
cached_json={
'data-url': 'https://bijoe.example.com/visualization/1/json/',
'path': 'https://bijoe.example.com/visualization/1/iframe/?signature=123',
'name': 'example visualization (X)',
'slug': 'example',
},
)
executor = MigrationExecutor(connection)
executor.migrate(migrate_to)
executor.loader.build_graph()
apps = executor.loader.project_state(migrate_to).apps
ChartNgCell = apps.get_model(app, 'ChartNgCell')
cell = ChartNgCell.objects.get(pk=cell.pk)
assert cell.statistic.slug == 'example'
assert cell.statistic.label == 'example visualization (X)'
assert cell.statistic.url == 'https://bijoe.example.com/visualization/1/json/'
assert cell.statistic.site_slug == 'plop'
assert cell.statistic.service_slug == 'bijoe'
assert cell.statistic.site_title == 'test'
@with_httmock(new_api_mock)
def test_dataviz_api_list_statistics(new_api_statistics, settings):
statistic = Statistic.objects.get(slug='one-serie')