misc: add event descriptions to json export (#36591)
This commit is contained in:
parent
cd7521a5ed
commit
c59b4b9e86
|
@ -352,7 +352,8 @@ class Event(models.Model):
|
||||||
'start_datetime': make_naive(self.start_datetime).strftime('%Y-%m-%d %H:%M:%S'),
|
'start_datetime': make_naive(self.start_datetime).strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
'places': self.places,
|
'places': self.places,
|
||||||
'waiting_list_places': self.waiting_list_places,
|
'waiting_list_places': self.waiting_list_places,
|
||||||
'label': self.label
|
'label': self.label,
|
||||||
|
'description': self.description,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,25 @@ def test_import_export(app, some_data, meetings_agenda):
|
||||||
shutil.rmtree(tempdir)
|
shutil.rmtree(tempdir)
|
||||||
|
|
||||||
|
|
||||||
|
def test_import_export_event_description(app, some_data, meetings_agenda):
|
||||||
|
first_event = Agenda.objects.get(label='Foo bar').event_set.first()
|
||||||
|
first_event.description = 'description'
|
||||||
|
first_event.save()
|
||||||
|
|
||||||
|
output = get_output_of_command('export_site')
|
||||||
|
assert len(json.loads(output)['agendas']) == 3
|
||||||
|
import_site(data={}, clean=True)
|
||||||
|
|
||||||
|
with tempfile.NamedTemporaryFile() as f:
|
||||||
|
f.write(force_bytes(output))
|
||||||
|
f.flush()
|
||||||
|
call_command('import_site', f.name)
|
||||||
|
|
||||||
|
assert Agenda.objects.count() == 3
|
||||||
|
first_imported_event = Agenda.objects.get(label='Foo bar').event_set.first()
|
||||||
|
assert first_imported_event.description == 'description'
|
||||||
|
|
||||||
|
|
||||||
def test_import_export_permissions(app, some_data, meetings_agenda):
|
def test_import_export_permissions(app, some_data, meetings_agenda):
|
||||||
group1 = Group(name=u'gé1')
|
group1 = Group(name=u'gé1')
|
||||||
group1.save()
|
group1.save()
|
||||||
|
|
Loading…
Reference in New Issue