Add sub-events and relative date settings (#503)

* Data model

* little crud

* SubEventItemForm etc

* Drop SubEventItem.active, quota editor

* Fix failing tests

* First frontend stuff

* Addons form stuff

* Quota calculation

* net price display on EventIndex

* Add tests, solve some bugs

* Correct quota selection in more places, consolidate pricing logic

* Fix failing quota tests

* Fix TypeError

* Add tests for checkout

* Fixed a bug in QuotaForm

* Prevent immutable cart if a quota was removed from an item

* Add tests for pricing

* Handle waiting list

* Filter in check-in list

* Fixed import lost in rebase

* Fix waiting list widget

* Voucher management

* Voucher redemption

* Fix broken tests

* Add subevents to OrderChangeManager

* Create a subevent during event creation

* Fix bulk voucher creation

* Introduce subevent.active

* Copy from for subevents

* Show active in list

* ICal download for subevents

* Check start and end of presale

* Failing tests / show cart logic

* Test

* Rebase migrations

* REST API integration of sub-events

* Integrate quota calculation into the traditional quota form

* Make subevent argument to add_position optional

* Log-display foo

* pretixdroid and subevents

* Filter by subevent

* Add more tests

* Some mor tests

* Rebase fixes

* More tests

* Relative dates

* Restrict selection in relative datetime widgets

* Filter subevent list

* Re-label has_subevents

* Rebase fixes, subevents in calendar view

* Performance and caching issues

* Refactor calendar templates

* Permission tests

* Calendar fixes and month selection

* subevent selection

* Rename subevents to dates

* Add tests for calendar views
This commit is contained in:
Raphael Michel
2017-07-11 13:56:00 +02:00
committed by GitHub
parent 554800c06f
commit 8123effa65
141 changed files with 5920 additions and 1012 deletions

View File

@@ -1,7 +1,8 @@
from datetime import timedelta
from datetime import datetime, timedelta
import pytest
from django.utils.timezone import now
from pytz import UTC
from pretix.base.models import Event, Organizer
@@ -95,3 +96,26 @@ def test_different_organizer_not_shown(env, client):
)
r = client.get('/mrmcd/')
assert '32C3' not in r.rendered_content
@pytest.mark.django_db
def test_calendar(env, client):
env[0].settings.event_list_type = 'calendar'
e = Event.objects.create(
organizer=env[0], name='MRMCD2017', slug='2017',
date_from=datetime(now().year + 1, 9, 1, tzinfo=UTC),
live=True
)
r = client.get('/mrmcd/')
assert 'MRMCD2017' not in r.rendered_content
e.is_public = True
e.save()
r = client.get('/mrmcd/')
assert 'MRMCD2017' in r.rendered_content
assert 'September %d' % (now().year + 1) in r.rendered_content
r = client.get('/mrmcd/events/2017/10/')
assert 'MRMCD2017' not in r.rendered_content
assert 'October 2017' in r.rendered_content
r = client.get('/mrmcd/events/?month=10&year=2017')
assert 'MRMCD2017' not in r.rendered_content
assert 'October 2017' in r.rendered_content