2148 |
2148 |
resp.form['all_desks'] = True
|
2149 |
2149 |
resp = resp.form.submit().follow()
|
2150 |
2150 |
assert TimePeriodException.objects.count() == 4
|
2151 |
|
assert 'Exceptions added. Note: one or several bookings exists within this time slot.' in resp.text
|
|
2151 |
assert 'Exceptions added.' in resp.text
|
|
2152 |
assert 'One or several bookings exists within this time slot.' in resp.text
|
2152 |
2153 |
|
2153 |
2154 |
exception = TimePeriodException.objects.first()
|
2154 |
2155 |
resp = app.get('/manage/time-period-exceptions/%s/edit' % exception.pk)
|
... | ... | |
2173 |
2174 |
resp.form['all_desks'] = False
|
2174 |
2175 |
resp = resp.form.submit().follow()
|
2175 |
2176 |
assert TimePeriodException.objects.count() == 5
|
2176 |
|
assert 'Exception added. Note: one or several bookings exists within this time slot.' in resp.text
|
|
2177 |
assert 'Exception added.' in resp.text
|
|
2178 |
assert 'One or several bookings exists within this time slot.' in resp.text
|
2177 |
2179 |
|
2178 |
2180 |
|
2179 |
2181 |
def test_meetings_agenda_add_time_period_exception_when_booking_exists(app, admin_user):
|
... | ... | |
2199 |
2201 |
resp.form['end_datetime_0'] = '2017-05-26'
|
2200 |
2202 |
resp.form['end_datetime_1'] = '17:30'
|
2201 |
2203 |
resp = resp.form.submit().follow()
|
2202 |
|
assert 'Exception added. Note: one or several bookings exists within this time slot.' in resp.text
|
|
2204 |
assert 'Exception added.' in resp.text
|
|
2205 |
assert 'One or several bookings exists within this time slot.' in resp.text
|
2203 |
2206 |
assert TimePeriodException.objects.count() == 1
|
2204 |
2207 |
|
2205 |
2208 |
|
... | ... | |
2256 |
2259 |
login(app)
|
2257 |
2260 |
resp = app.get('/manage/time-period-exceptions/%s/edit' % time_period_exception.pk)
|
2258 |
2261 |
resp = resp.form.submit().follow()
|
2259 |
|
assert (
|
2260 |
|
'Exception updated. Note: one or several bookings exists within this time slot.' not in resp.text
|
2261 |
|
)
|
|
2262 |
assert 'Exception updated.' not in resp.text
|
|
2263 |
assert 'One or several bookings exists within this time slot.' not in resp.text
|
2262 |
2264 |
|
2263 |
2265 |
booking = Booking.objects.create(event=event)
|
2264 |
2266 |
resp = app.get('/manage/time-period-exceptions/%s/edit' % time_period_exception.pk)
|
2265 |
2267 |
resp = resp.form.submit().follow()
|
2266 |
|
assert 'Exception updated. Note: one or several bookings exists within this time slot.' in resp.text
|
|
2268 |
assert 'Exception updated.' in resp.text
|
|
2269 |
assert 'One or several bookings exists within this time slot.' in resp.text
|
2267 |
2270 |
|
2268 |
2271 |
booking.cancel()
|
2269 |
2272 |
resp = app.get('/manage/time-period-exceptions/%s/edit' % time_period_exception.pk)
|
2270 |
2273 |
resp = resp.form.submit().follow()
|
2271 |
|
assert (
|
2272 |
|
'Exception updated. Note: one or several bookings exists within this time slot.' not in resp.text
|
2273 |
|
)
|
|
2274 |
assert 'Exception updated.' not in resp.text
|
|
2275 |
assert 'One or several bookings exists within this time slot.' not in resp.text
|
2274 |
2276 |
|
2275 |
2277 |
booking.delete()
|
2276 |
2278 |
event.delete()
|
2277 |
|
-
|