diff --git a/livestyled/__init__.py b/livestyled/__init__.py index a314565..14895e4 100644 --- a/livestyled/__init__.py +++ b/livestyled/__init__.py @@ -1 +1 @@ -__version__ = '1.4.11' +__version__ = '1.4.12' diff --git a/livestyled/models/tests/test_ticket.py b/livestyled/models/tests/test_ticket.py index 651aef0..f88b904 100644 --- a/livestyled/models/tests/test_ticket.py +++ b/livestyled/models/tests/test_ticket.py @@ -12,6 +12,7 @@ def test_ticket_difference(): external_event_id=282848348, price_code='GBP', price_type='Full price', + price_zone='Some price zone', barcode=83736474849494, sector_name='C', section='20', @@ -55,6 +56,7 @@ def test_ticket_difference(): external_event_id=282848348, price_code='GBP', price_type='Full price', + price_zone='Some price zone', barcode=83736474849494, sector_name='C', section='20', @@ -108,6 +110,7 @@ def test_ticket_difference_with_empty_ticket_additional_fields(): external_event_id=282848348, price_code='GBP', price_type='Full price', + price_zone='Some price zone', barcode=83736474849494, sector_name='C', section='20', @@ -142,6 +145,7 @@ def test_ticket_difference_with_empty_ticket_additional_fields(): external_event_id=282848348, price_code='GBP', price_type='Full price', + price_zone='Some price zone', barcode=83736474849494, sector_name='C', section='20', diff --git a/livestyled/models/ticket.py b/livestyled/models/ticket.py index 3e4424e..3873f08 100644 --- a/livestyled/models/ticket.py +++ b/livestyled/models/ticket.py @@ -31,6 +31,7 @@ def __init__( row, price_code, price_type, + price_zone, created_at, updated_at, user_id, @@ -88,6 +89,7 @@ def __init__( self.row = row self.price_code = price_code self.price_type = price_type + self.price_zone = price_zone if user_id: self._user = User.placeholder(id=user_id) else: @@ -204,6 +206,7 @@ def placeholder( row=None, price_code=None, price_type=None, + price_zone=None, created_at=None, updated_at=None, user_id=None, @@ -260,6 +263,7 @@ def create_new( external_customer_ref=None, price_code=None, price_type=None, + price_zone=None, entrance=None, status=None, can_share=False, @@ -315,6 +319,7 @@ def create_new( row=row, price_code=price_code, price_type=price_type, + price_zone=price_zone, user_id=None, status=status, can_share=can_share, @@ -407,7 +412,7 @@ def diff(self, existing): 'client_email', 'price', 'status', 'can_share', 'sharer_email', 'redeemed_at', 'redeemer_id', 'share_code', 'redeemer_email', 'parent_ticket', 'shared_at', 'legal_long_text', 'legal_short_text', 'map_url', 'map_image_url', 'ticket_integration', 'entrance', 'row', 'section', 'price_code', 'price_type', - 'external_customer_ref', 'venue', 'event', 'event_date', 'currency', 'external_card_ref', + 'price_zone', 'external_customer_ref', 'venue', 'event', 'event_date', 'currency', 'external_card_ref', 'additional_fields', 'printed', 'timezone', 'ticket_type', 'aisle' ) for field in fields: diff --git a/livestyled/schemas/tests/test_ticket.py b/livestyled/schemas/tests/test_ticket.py index 20b2597..541afb6 100644 --- a/livestyled/schemas/tests/test_ticket.py +++ b/livestyled/schemas/tests/test_ticket.py @@ -30,6 +30,7 @@ def test_deserialize_ticket(): 'price': 199, 'price_code': None, 'price_type': None, + 'price_zone': None, 'qr_code_url': '', 'redeemer_email': None, 'redeemer_id': None, @@ -116,6 +117,7 @@ def test_deserialize_ticket_shared(): 'price': 199, 'price_code': None, 'price_type': None, + 'price_zone': None, 'qr_code_url': '', 'redeemer_email': None, 'redeemer_id': None, @@ -177,6 +179,7 @@ def test_deserialize_ticket_shared_redeemed(): 'price': 199, 'price_code': None, 'price_type': None, + 'price_zone': None, 'qr_code_url': '', 'redeemer_email': 'someoneelse@livestyled.com', 'redeemer_id': 1234, @@ -238,6 +241,7 @@ def test_deserialize_ticket_with_event_and_venue(): 'price': None, 'price_code': 'LÄKTARE 1 LÅNGSIDA,', 'price_type': None, + 'price_zone': None, 'qr_code_url': 'http://api-staging.livestyled.com/v3/web/tickets/qr-code/224199046363003230328509.png', 'redeemer_email': None, 'redeemer_id': None, @@ -321,6 +325,7 @@ def test_serialize_ticket(): 'seat': None, 'price': 0, 'priceType': None, + 'priceZone': None, 'externalCustomerRef': None, 'sessionDate': None, 'redeemerEmail': None, diff --git a/livestyled/schemas/ticket.py b/livestyled/schemas/ticket.py index b0dc02b..4a221b6 100644 --- a/livestyled/schemas/ticket.py +++ b/livestyled/schemas/ticket.py @@ -68,6 +68,7 @@ class Meta: status = fields.String(required=False, missing=None) price_code = fields.String(data_key='priceCode', required=False, missing=None) price_type = fields.String(data_key='priceType', required=False, missing=None) + price_zone = fields.String(data_key='priceZone', required=False, missing=None) created_at = fields.AwareDateTime(data_key='createdAt', allow_none=False) updated_at = fields.AwareDateTime(data_key='updatedAt', allow_none=False) user_id = RelatedResourceLinkField(schema=UserSchema, required=False, missing=None, data_key='user', microservice_aware=False) diff --git a/livestyled/tests/test_resource_client_ticket.py b/livestyled/tests/test_resource_client_ticket.py index 609cb4a..2957375 100644 --- a/livestyled/tests/test_resource_client_ticket.py +++ b/livestyled/tests/test_resource_client_ticket.py @@ -41,6 +41,7 @@ def test_get_ticket(requests_mock): assert ticket.price == 199 assert ticket.price_code is None assert ticket.price_type is None + assert ticket.price_zone is None assert ticket.redeemer_email is None assert ticket.redeemer_id is None assert ticket.redeemer is None @@ -89,6 +90,7 @@ def test_get_ticket_shared(requests_mock): assert ticket.price == 199 assert ticket.price_code is None assert ticket.price_type is None + assert ticket.price_zone is None assert ticket.redeemer_email is None assert ticket.redeemer_id is None assert ticket.redeemer is None @@ -137,6 +139,7 @@ def test_get_ticket_shared_redeemed(requests_mock): assert ticket.price == 199 assert ticket.price_code is None assert ticket.price_type is None + assert ticket.price_zone is None assert ticket.redeemer_email == 'someoneelse@livestyled.com' assert ticket.redeemer_id == 1234 assert isinstance(ticket.redeemer, User)