API-level tests

This commit is contained in:
Raphael Michel
2018-09-20 10:07:26 +02:00
parent 0bab8adc41
commit 1ba4047b1b
7 changed files with 232 additions and 4 deletions

View File

@@ -85,9 +85,10 @@ class Device(LoggedModel):
def permission_set(self) -> set:
return {
'can_change_items', # TODO: Remove, after read operations are allowed without
'can_view_orders',
'can_change_orders',
'can_view_products'
'can_view_vouchers', # TODO: Really required
}
def get_event_permission_set(self, organizer, event) -> set:

View File

@@ -1301,10 +1301,11 @@ def perform_order(self, event: str, payment_provider: str, positions: List[str],
@app.task(base=ProfiledTask, bind=True, max_retries=5, default_retry_delay=1, throws=(OrderError,))
def cancel_order(self, order: int, user: int=None, send_mail: bool=True, api_token=None, oauth_application=None):
def cancel_order(self, order: int, user: int=None, send_mail: bool=True, api_token=None, oauth_application=None,
device=None):
try:
try:
return _cancel_order(order, user, send_mail, api_token, oauth_application)
return _cancel_order(order, user, send_mail, api_token, device, oauth_application)
except LockTimeoutException:
self.retry()
except (MaxRetriesExceededError, LockTimeoutException):