Skip to content

TEST Data

Use client.testdata only in Environment.TEST. These helpers mutate sandbox data so your tests and demos can create known contexts.

client.testdata.create_subject(
nip="5261040828",
subject_type="vat_group",
description="Sandbox company",
)
client.testdata.enable_attachments(nip="5261040828")
client.testdata.delete_subject(nip="5261040828")

The temporal helper records mutations and attempts cleanup when the block exits.

with client.testdata.temporal() as data:
data.create_subject(
nip="5261040828",
subject_type="vat_group",
description="Integration test subject",
)
data.enable_attachments(nip="5261040828")
  1. Create subjects, people, permissions, or attachment flags required by a test.

  2. Use temporal() for fixtures that should be cleaned up automatically.

  3. Use direct create/delete methods when setup is shared across many test runs.

  4. Keep generated identifiers in test config, not production config.