Skip to content

Commit

Permalink
AVB-759: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samulenti committed Jun 6, 2024
1 parent 039dad0 commit a77fa4c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion livestyled/schemas/tests/fixtures/example_ticket.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"sort": 0
}
],
"ticketType": "ticket"
"ticketType": "ticket",
"aisle": "aisle"
}
3 changes: 2 additions & 1 deletion livestyled/schemas/tests/fixtures/example_ticket_shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"shareCode": "ABCDEF12345",
"sharedAt": "2019-05-24T12:41:22+00:00",
"sharerEmail": "[email protected]",
"ticketType": "ticket"
"ticketType": "ticket",
"aisle": "aisle"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"redeemerEmail": "[email protected]",
"redeemedAt": "2019-05-24T13:41:22+00:00",
"redeemer": "/v4/users/1234",
"ticketType": "ticket"
"ticketType": "ticket",
"aisle": "aisle"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
"clientEmail": "[email protected]",
"clientId": "[email protected]"
},
"ticketType": "ticket"
"ticketType": "ticket",
"aisle": "aisle"
}
7 changes: 7 additions & 0 deletions livestyled/schemas/tests/test_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def test_deserialize_ticket():
'printed': True,
'timezone': None,
'ticket_type': 'ticket',
'aisle': 'aisle',
}


Expand Down Expand Up @@ -152,6 +153,7 @@ def test_deserialize_ticket_shared():
'printed': True,
'timezone': None,
'ticket_type': 'ticket',
'aisle': 'aisle',
}


Expand Down Expand Up @@ -212,6 +214,7 @@ def test_deserialize_ticket_shared_redeemed():
'printed': True,
'timezone': None,
'ticket_type': 'ticket',
'aisle': 'aisle',
}


Expand Down Expand Up @@ -286,6 +289,7 @@ def test_deserialize_ticket_with_event_and_venue():
'printed': True,
'timezone': None,
'ticket_type': 'ticket',
'aisle': 'aisle',
}


Expand All @@ -300,6 +304,7 @@ def test_serialize_ticket():
event=9999,
user=8888,
ticket_type='ticket',
aisle='aisle',
)
serialized_ticket = TicketSchema().dump(ticket)
assert serialized_ticket == {
Expand Down Expand Up @@ -354,6 +359,7 @@ def test_serialize_ticket():
'printed': True,
'timezone': None,
'ticketType': 'ticket',
'aisle': 'aisle',
}


Expand Down Expand Up @@ -427,6 +433,7 @@ def get_ticket(data: Dict or None = None):
],
'timezone': None,
'ticket_type': 'ticket',
'aisle': 'aisle',
}

if data:
Expand Down
9 changes: 6 additions & 3 deletions livestyled/tests/test_resource_client_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def test_get_ticket(requests_mock):
assert ticket.venue_name is None
assert ticket.venue_room is None
assert ticket.redeemed_at is None
assert ticket.ticket_type is 'ticket'
assert ticket.ticket_type == 'ticket'
assert ticket.aisle is None


def test_get_ticket_shared(requests_mock):
Expand Down Expand Up @@ -104,7 +105,8 @@ def test_get_ticket_shared(requests_mock):
assert ticket.venue_name is None
assert ticket.venue_room is None
assert ticket.redeemed_at is None
assert ticket.ticket_type is 'ticket'
assert ticket.ticket_type == 'ticket'
assert ticket.aisle is None


def test_get_ticket_shared_redeemed(requests_mock):
Expand Down Expand Up @@ -152,7 +154,8 @@ def test_get_ticket_shared_redeemed(requests_mock):
assert ticket.venue_name is None
assert ticket.venue_room is None
assert ticket.redeemed_at == datetime(2019, 5, 24, 13, 41, 22, tzinfo=timezone(timedelta(0), '+0000'))
assert ticket.ticket_type is 'ticket'
assert ticket.ticket_type == 'ticket'
assert ticket.aisle is None


def test_create_ticket(requests_mock):
Expand Down

0 comments on commit a77fa4c

Please sign in to comment.