0001-manager-allow-timeperiod-exceptions-with-the-same-su.patch
chrono/agendas/models.py | ||
---|---|---|
528 | 528 | |
529 | 529 |
kwargs = {} |
530 | 530 |
kwargs['desk'] = self |
531 |
if keep_synced_by_uid: |
|
531 |
if 'uid' in vevent.contents or keep_synced_by_uid:
|
|
532 | 532 |
kwargs['external_id'] = vevent.contents['uid'][0].value |
533 | 533 |
else: |
534 | 534 |
kwargs['label'] = summary |
tests/test_manager.py | ||
---|---|---|
987 | 987 |
DTEND:20180101 |
988 | 988 |
SUMMARY:New Year's Eve |
989 | 989 |
END:VEVENT |
990 |
BEGIN:VEVENT |
|
991 |
DTSTART:20190101 |
|
992 |
DTEND:20190101 |
|
993 |
SUMMARY:New Year's Eve |
|
994 |
END:VEVENT |
|
990 | 995 |
END:VCALENDAR""" |
991 | 996 |
resp = app.get('/manage/agendas/%d/' % agenda.pk).follow() |
992 | 997 |
resp = resp.click('Settings') |
... | ... | |
996 | 1001 |
assert TimePeriodException.objects.filter(desk=desk).count() == 1 |
997 | 1002 |
resp = resp.follow() |
998 | 1003 |
assert 'An exception has been imported.' in resp.text |
1004 |
ics_with_exceptions_with_uids = b"""BEGIN:VCALENDAR |
|
1005 |
VERSION:2.0 |
|
1006 |
PRODID:-//foo.bar//EN |
|
1007 |
BEGIN:VEVENT |
|
1008 |
DTSTART:20180101 |
|
1009 |
UID:31f3f68e |
|
1010 |
DTEND:20180101 |
|
1011 |
SUMMARY:New Year's Eve |
|
1012 |
END:VEVENT |
|
1013 |
BEGIN:VEVENT |
|
1014 |
UID:31f3f68c |
|
1015 |
DTSTART:20190101 |
|
1016 |
DTEND:20190101 |
|
1017 |
SUMMARY:New Year's Eve |
|
1018 |
END:VEVENT |
|
1019 |
END:VCALENDAR""" |
|
1020 |
resp = resp.click('upload') |
|
1021 |
resp.form['ics_file'] = Upload('exceptions.ics', ics_with_exceptions_with_uids, 'text/calendar') |
|
1022 |
resp = resp.form.submit(status=302) |
|
1023 |
assert TimePeriodException.objects.filter(desk=desk, label='New Year\'s Eve').count() == 3 |
|
999 | 1024 | |
1000 | 1025 | |
1001 | 1026 |
@pytest.mark.freeze_time('2017-12-01') |
1002 |
- |