misc: remove compatibility with old export format (#68554)
gitea-wip/combo/pipeline/head There was a failure building this commit Details
gitea/combo/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Lauréline Guérin 2022-08-30 15:59:43 +02:00
parent 5ddfa0503a
commit bf62d743a5
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 1 additions and 13 deletions

View File

@ -87,11 +87,6 @@ def export_site(pages=True, cartography=True, pwa=True, assets=True, payment=Tru
def import_site(data, if_empty=False, clean=False, request=None):
if isinstance(data, list):
# old export form with a list of pages, convert it to new dictionary
# format.
data = {'pages': data}
if 'combo.apps.lingo' in settings.INSTALLED_APPS:
from combo.apps.lingo.models import PaymentBackend, Regie

View File

@ -87,7 +87,7 @@ def test_import_export(app, some_data):
assert Page.objects.count() == 3
assert TextCell.objects.all().count() == 1
import_site(data=[], clean=True)
import_site(data={}, clean=True)
tempdir = tempfile.mkdtemp('chrono-test')
empty_output = get_output_of_command('export_site', output=os.path.join(tempdir, 't.json'))
assert os.path.exists(os.path.join(tempdir, 't.json'))
@ -139,13 +139,6 @@ def test_import_export_with_nested_parents():
assert two.parent.slug == 'two'
def test_backward_compatibility_import(app, some_data):
old_export = Page.export_all_for_json()
Page.objects.all().delete()
import_site(data=old_export)
assert Page.objects.count() == 3
def test_import_export_map_layers(app, some_map_layers):
output = get_output_of_command('export_site')
assert len(json.loads(output)['map-layers']) == 2