def event(self, type, quantity=None):
        event = ShippingEvent.objects.create(order=self.order, event_type=type)
        if quantity is None:
            quantity = self.line.quantity
        ShippingEventQuantity.objects.create(
            event=event, line=self.line, quantity=quantity)
Creates a shipping event for the test line
dataset/ETHPy150Open django-oscar/django-oscar/tests/integration/order/model_tests.py/LineTests.event