mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Refactor cancelling positions and orders in the data model (#1088)
- [x] Data model - [x] display in order view in backend - [x] review all usages of OrderPositions.objects - [x] review all usages of order.positions - [x] review all other model usages - [x] review plugins - [x] plugins backwards-compatible API? - [x] decide on way forward for REST API - [x] need to cancel fees - [x] tests - [ ] plugins - [ ] gdpr - [ ] reports - [x] docs
This commit is contained in:
@@ -740,7 +740,7 @@ class OrderTestCase(BaseQuotaTestCase):
|
||||
q = Question.objects.create(question='Foo', type=Question.TYPE_BOOLEAN, event=self.event)
|
||||
self.item1.questions.add(q)
|
||||
assert self.order.can_modify_answers
|
||||
self.order.status = Order.STATUS_REFUNDED
|
||||
self.order.status = Order.STATUS_CANCELED
|
||||
assert not self.order.can_modify_answers
|
||||
self.order.status = Order.STATUS_PAID
|
||||
assert self.order.can_modify_answers
|
||||
@@ -963,7 +963,7 @@ class OrderTestCase(BaseQuotaTestCase):
|
||||
assert o.has_external_refund
|
||||
|
||||
def test_pending_order_pending_refund(self):
|
||||
self.order.status = Order.STATUS_REFUNDED
|
||||
self.order.status = Order.STATUS_CANCELED
|
||||
self.order.save()
|
||||
self.order.payments.create(
|
||||
amount=Decimal('46.00'),
|
||||
@@ -1023,6 +1023,14 @@ class OrderTestCase(BaseQuotaTestCase):
|
||||
assert not o.has_pending_refund
|
||||
assert not o.has_external_refund
|
||||
|
||||
def test_canceled_positions(self):
|
||||
self.op1.canceled = True
|
||||
self.op1.save()
|
||||
assert OrderPosition.objects.count() == 1
|
||||
assert OrderPosition.all.count() == 2
|
||||
assert self.order.positions.count() == 1
|
||||
assert self.order.all_positions.count() == 2
|
||||
|
||||
|
||||
class ItemCategoryTest(TestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user