The bot configuration contains multiple Pretix-related components:
- Environment variable
PRETIX_TOKEN - Configuration section
[registration]
If you don't have access to a real Pretix instance (or you prefer a small test instance), you can use the script scripts/pretix-mock.py.
The script has no dependencies. Simply choose an available port and run it in a separate terminal:
python scripts/pretix-mock.py --port 8080This will host an HTTP server on http://localhost:8080.
Set the environment variable PRETIX_TOKEN to any string:
# macOS, Linux
export PRETIX_TOKEN="pretix-mock-token"
# Windows
$env:PRETIX_TOKEN = 'pretix-mock-token'You can use the configuration values from test-config.toml.
Make sure the entry pretix_base_url matches the port of your mock:
If you use python pretix-mock.py --port 8888, set pretix_base_url to http://localhost:8888.
The mock contains five Pretix orders:
Order 'AAA11' (paid)
- Business Combined Ticket for 'Jane Doe'
- Business Tutorial Ticket for 'John Doe'
- Childcare
Order 'BBB22' (paid)
- Volunteer Ticket for 'Minta János'
- Speaker Ticket for 'Minta Kata'
- T-Shirt
Order 'CCC33' (paid)
- Personal Remote Ticket for 'Martina Mustermann'
Order 'DDD44' (paid)
- Sponsor Ticket for 'Seán Ó Rudaí'
- T-Shirt
Order 'EEE55' (payment pending)
- Personal Late Conference Ticket for 'Numerius Negidius'
If you want to use a real Pretix instance, make sure the [configuration] section in your bot
configuration file matches the Pretix items and item variations.
Set the environment variable PRETIX_TOKEN to your access token, and the configuration entry
pretix_base_url to the base URL of your Pretix instance's API.
It typically looks like this:
https://pretix.eu/api/v1/organizers/<organization>/events/<event>