Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove more fixtures #975

Merged
merged 9 commits into from
Oct 1, 2024
165 changes: 0 additions & 165 deletions tests/unit/routers/contacts/test_api_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,171 +74,6 @@ def test_get_ctms_for_minimal_contact(client, email_factory):
}


def test_get_ctms_for_maximal_contact(client, maximal_contact):
"""GET /ctms/{email_id} returns a contact with almost all fields set."""
email_id = maximal_contact.email.email_id
resp = client.get(f"/ctms/{email_id}")
assert resp.status_code == 200
assert resp.json() == {
"amo": {
"add_on_ids": "fanfox,foxfan",
"create_timestamp": "2017-05-12T15:16:00+00:00",
"display_name": "#1 Mozilla Fan",
"email_opt_in": True,
"language": "fr,en",
"last_login": "2020-01-27",
"location": "The Inter",
"profile_url": "firefox/user/14508209",
"update_timestamp": "2020-01-27T14:25:43+00:00",
"user": True,
"user_id": "123",
"username": "Mozilla1Fan",
},
"email": {
"basket_token": "d9ba6182-f5dd-4728-a477-2cc11bf62b69",
"create_timestamp": "2010-01-01T08:04:00+00:00",
"double_opt_in": True,
"email_format": "H",
"email_id": "67e52c77-950f-4f28-accb-bb3ea1a2c51a",
"email_lang": "fr",
"first_name": "Fan",
"has_opted_out_of_email": False,
"last_name": "of Mozilla",
"mailing_country": "ca",
"primary_email": "[email protected]",
"sfdc_id": "001A000001aMozFan",
"unsubscribe_reason": "done with this mailing list",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
"fxa": {
"created_date": "2019-05-22T08:29:31.906094+00:00",
"account_deleted": False,
"first_service": "monitor",
"fxa_id": "611b6788-2bba-42a6-98c9-9ce6eb9cbd34",
"lang": "fr,fr-CA",
"primary_email": "[email protected]",
},
"mofo": {
"mofo_contact_id": "5e499cc0-eeb5-4f0e-aae6-a101721874b8",
"mofo_email_id": "195207d2-63f2-4c9f-b149-80e9c408477a",
"mofo_relevant": True,
},
"newsletters": [
{
"format": "H",
"lang": "en",
"name": "ambassadors",
"source": "https://www.mozilla.org/en-US/contribute/studentambassadors/",
"subscribed": False,
"unsub_reason": "Graduated, don't have time for FSA",
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "T",
"lang": "fr",
"name": "common-voice",
"source": "https://commonvoice.mozilla.org/fr",
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "H",
"lang": "fr",
"name": "firefox-accounts-journey",
"source": "https://www.mozilla.org/fr/firefox/accounts/",
"subscribed": False,
"unsub_reason": "done with this mailing list",
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "H",
"lang": "en",
"name": "firefox-os",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "H",
"lang": "fr",
"name": "hubs",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "H",
"lang": "en",
"name": "mozilla-festival",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"format": "H",
"lang": "fr",
"name": "mozilla-foundation",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
],
"status": "ok",
"vpn_waitlist": {"geo": "ca", "platform": "windows,android"},
"relay_waitlist": {"geo": "cn"},
"waitlists": [
{
"fields": {"geo": "fr"},
"name": "a-software",
"source": "https://a-software.mozilla.org/",
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"fields": {"geo": "cn"},
"name": "relay",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"fields": {"geo": "fr", "platform": "win64"},
"name": "super-product",
"source": "https://super-product.mozilla.org/",
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
{
"fields": {"geo": "ca", "platform": "windows,android"},
"name": "vpn",
"source": None,
"subscribed": True,
"unsub_reason": None,
"create_timestamp": "2010-01-01T08:04:00+00:00",
"update_timestamp": "2020-01-28T14:50:00+00:00",
},
],
}
grahamalama marked this conversation as resolved.
Show resolved Hide resolved


def test_get_ctms_for_api_example(client, example_contact):
"""The API examples represent a valid contact with many fields set.
Test that the API examples are valid."""
Expand Down