def test_order_received_admin(rf, admin_user): get_test_script("test script", "order_received") template_data = STEP_DATA[0]["actions"][0]["template_data"] for lang in ["en", "fi"]: get_initial_order_status() # Needed for the API n_outbox_pre = len(mail.outbox) contact = create_random_person(locale=lang, minimum_name_comp_len=5) get_order_from_state(get_frontend_order_state(contact), admin_user) assert (len(mail.outbox) == n_outbox_pre + 1), "Sending email failed" latest_mail = mail.outbox[-1] assert latest_mail.subject == template_data[lang]["subject"], "Subject doesn't match" assert latest_mail.body == template_data[lang]["body"], "Body doesn't match"