0001-misc-add-event-descriptions-to-json-export-36591.patch
chrono/agendas/models.py | ||
---|---|---|
352 | 352 |
'start_datetime': make_naive(self.start_datetime).strftime('%Y-%m-%d %H:%M:%S'), |
353 | 353 |
'places': self.places, |
354 | 354 |
'waiting_list_places': self.waiting_list_places, |
355 |
'label': self.label |
|
355 |
'label': self.label, |
|
356 |
'description': self.description, |
|
356 | 357 |
} |
357 | 358 | |
358 | 359 |
tests/test_import_export.py | ||
---|---|---|
122 | 122 |
shutil.rmtree(tempdir) |
123 | 123 | |
124 | 124 | |
125 |
def test_import_export_event_description(app, some_data, meetings_agenda): |
|
126 |
first_event = Agenda.objects.get(label='Foo bar').event_set.first() |
|
127 |
first_event.description = 'description' |
|
128 |
first_event.save() |
|
129 | ||
130 |
output = get_output_of_command('export_site') |
|
131 |
assert len(json.loads(output)['agendas']) == 3 |
|
132 |
import_site(data={}, clean=True) |
|
133 | ||
134 |
with tempfile.NamedTemporaryFile() as f: |
|
135 |
f.write(force_bytes(output)) |
|
136 |
f.flush() |
|
137 |
call_command('import_site', f.name) |
|
138 | ||
139 |
assert Agenda.objects.count() == 3 |
|
140 |
first_imported_event = Agenda.objects.get(label='Foo bar').event_set.first() |
|
141 |
assert first_imported_event.description == 'description' |
|
142 | ||
143 | ||
125 | 144 |
def test_import_export_permissions(app, some_data, meetings_agenda): |
126 | 145 |
group1 = Group(name=u'gé1') |
127 | 146 |
group1.save() |
128 |
- |