Indian Fake Address Generator for PIN Code Tests

Use a synthetic India address fixture for form and import tests. Check the Indian postcode layout and local address fields.

Generator settings

Advanced settings

Preview

Example
  • 42 Test Lane

Test fixture

{
  "street": "42 Test Lane",
  "locality": "Sample Colony",
  "city": "New Delhi",
  "region": "Delhi",
  "postalCode": "110001",
  "country": "IN"
}

Address format

India uses a six digit Postal Index Number, often labeled PIN code. Keep it as text in fixtures and distinguish it from authentication PINs in APIs and logs. An address form can also collect locality, post town, district and state. This example has a synthetic delivery line and an illustrative New Delhi PIN.

Exercise an optional landmark or locality field with a long value on a narrow screen. Check that editing only the landmark leaves the rest of the address intact and that the extra line prints in the expected order. Use a separate fixture with the same post town and district labels if the UI has separate fields for both.

Form and import tests

For a checkout where a PIN service selects the state, use a controlled lookup response. Test the timing of a user rapidly replacing one PIN with another. The earlier response should not overwrite the latest address. Stub the empty-result and timeout cases separately to check manual entry and feedback.

Verify the exported fixture includes the state name or code your commerce platform expects. Add a case that goes through address entry in a local script and returns from the saved address book, checking that characters and line breaks are preserved. Run the service integration with delivery features disabled outside a provider sandbox.

Fixture assertions

Test one PIN with only five digits and another with seven. Check the difference between malformed input and a recognized format for which the lookup has no result. When a payment form reuses shipping details, verify that the six-digit field maps to postalCode in both billing and shipping requests.

The JavaScript checks the sample’s six digit format and that the locality is present. A regex by itself cannot tell you whether a synthetic premise exists or receives deliveries. Keep the structure assertions fast and local, then verify actual address acceptance through an integration case using approved test records.

JavaScript test example

const fixture = {
  "street": "42 Test Lane",
  "locality": "Sample Colony",
  "city": "New Delhi",
  "region": "Delhi",
  "postalCode": "110001",
  "country": "IN"
};
const postcode = fixture.postalCode;
if (!/^[1-9]\d{5}$/.test(postcode) || !(fixture.locality.length > 0)) {
  throw new Error("Address fixture failed");
}

Related generators