misc: make individual page export importable (#16705)
This commit is contained in:
parent
4f813b59e2
commit
730f73a9a3
|
@ -256,7 +256,7 @@ class PageExportView(DetailView):
|
|||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
response = HttpResponse(content_type='application/json')
|
||||
json.dump(self.object.get_serialized_page(), response, indent=2)
|
||||
json.dump({'pages': [self.object.get_serialized_page()]}, response, indent=2)
|
||||
return response
|
||||
|
||||
page_export = PageExportView.as_view()
|
||||
|
|
|
@ -215,7 +215,7 @@ def test_export_page(app, admin_user):
|
|||
resp = app.get('/manage/pages/%s/' % page.id)
|
||||
resp = resp.click('export')
|
||||
assert resp.headers['content-type'] == 'application/json'
|
||||
assert resp.json.get('fields').get('slug') == 'one'
|
||||
assert resp.json['pages'][0].get('fields').get('slug') == 'one'
|
||||
|
||||
def test_export_page_order():
|
||||
Page.objects.all().delete()
|
||||
|
|
Loading…
Reference in New Issue