Atomside docsThis page as Markdown

Test mode and the test postcodes

Test mode runs everything a live letter does (the address check, the render, the checks, the price, the rules, approvals, webhooks, a test record) and prints, posts and charges nothing. Test credits are not money.

A test key starts as_test_; a live key as_live_. A key is one mode. get_account says which (mode.name), and every quote says "test": true.

Moving a test letter along

advance_test_letter moves a test letter one stage, as the print room would: queued, printing, printed, posted, on record. Each step sends the webhook events a live letter would. A live key gets test_mode_only.

Rehearsing what goes wrong

Address a test letter to one of these postcodes and it takes that path. Any other test letter takes the happy path. A test postcode is refused with a live key (test_postcode_in_live).

PostcodeWhat happens
TEST 01Approved and posted, simulated. Follows the agent's approval mode, is printed, becomes a test record.
TEST 02Declined. Waits for approval in any mode, then a sample person declines it with a sample reason. Held test credits come back.
TEST 03Quote lapsed. Waits for approval and nobody answers. Nothing sent, held credits released.
TEST 04Address not found. quote_letter returns address_not_found with two sample close matches. Nothing charged.
TEST 05Held by Atomside. A sample reviewer question appears on the letter with a box to reply. Reply with anything and it goes ahead.
TEST 06Declined by Atomside. Held, then declined by our reviewer with a sample reason. Held test credits come back.
TEST 07Marked as returned. Goes on record, then comes back to sender one stage later.
TEST 08Held as a possible duplicate of a sample earlier letter, even on autopilot. Discard, send anyway or stop asking, as in live. The real check runs too: send the same letter twice to any address.
TEST 09Daily limit reached. send_letter answers as if the daily limit were used up, whatever is left of it. As in live: refused with over_daily_limit on autopilot, otherwise it waits for approval (needs_approval).
TEST 10Sending paused. The agent is paused as if a safeguard tripped. Every send is refused: paused by a safeguard, nothing charged, do not retry. Resume it from the banner, as in live.
TEST 11Posting day moved. Sent with any post_on, it is scheduled, then moved to the next posting day as if we were away.
TEST 12Day full. quote_letter with any post_on returns post_on_not_available, why day_full, with sample days either side.
TEST 13Missed its day. Sent with any post_on, it is scheduled, then held as if sending was stopped on the day. Pick a new day on the letter, or let it lapse.

The postcode can be written TEST 01 or test01. Use any street and town.

In a list of recipients, each line takes its own postcode's path: a TEST 04 line is left out of the quote as address_not_found while the rest are quoted. Test mode takes lists of up to 50 from the start.

Posting on a later day

post_on is checked against the real calendar in test mode, so your agent's date handling is tested for real, but test letters never fill a day. A scheduled test letter does not wait for its day: it shows as "Scheduled, simulated" and moves on at the speed set for test letters, or with advance_test_letter. TEST 11, TEST 12 and TEST 13 rehearse a moved day, a full day and a missed day; without post_on they take the happy path.

What to rehearse before going live