Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions tests/test_ansible_events_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,21 @@ def request(method, endpoint, payload=None, *, run_as=None):

assert requests == [
("GET", "u/gundalow/invited/pending.json", None, "gundalow"),
(
"POST",
"invites.json",
{
"skip_email": True,
"description": f"Join Ansible {barcelona.city}",
"group_names": f"{barcelona.attendee_group},{provision_environment.MIGRATED_GROUP_NAME}",
"max_redemptions_allowed": 5_000,
"expires_at": "2030-01-01",
},
"gundalow",
),
*[
(
"POST",
"invites.json",
{
"skip_email": True,
"description": f"Join Ansible {city.city}",
"group_names": f"{city.attendee_group},{provision_environment.MIGRATED_GROUP_NAME}",
"max_redemptions_allowed": 5_000,
"expires_at": "2030-01-01",
},
"gundalow",
)
for city in provision_environment.CITIES[1:]
],
]

def test_attendee_invites_fail_on_malformed_pending_response_before_creation(self, monkeypatch):
Expand Down
7 changes: 7 additions & 0 deletions tools/common/ansible_events_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def attendee_group(self) -> str:
CITIES: tuple[CityInfo, ...] = (
CityInfo(region="Europe", country="UK", slug="london", city="London", timezone="Europe/London"),
CityInfo(region="Europe", country="Spain", slug="barcelona", city="Barcelona", timezone="Europe/Madrid"),
CityInfo(
region="Americas",
country="Argentina",
slug="buenosaires",
city="Buenos Aires",
timezone="America/Argentina/Buenos_Aires",
),
)

if len({city.slug for city in CITIES}) != len(CITIES):
Expand Down
Loading