Configuration - lampmantech/behaving.trytond GitHub Wiki
The file
features/environment.cfg
contains the configuration information for the trytond server you are testing. Edit the settings to suit your setup; the default values are:
[trytond] user = admin password = admin database_name = test36 database_type = postgres config_file = /etc/trytond.conf [scenari] verbosity = 0 tracer =
If the trytond database does not exist, it will be created. You may need to define the Postgres user, port and pasword to create new databases, by setting environment variables:
export PGPASSWORD='postgres' # server_password export PGUSER='tryton' # server_user export PGPORT=5432 export PGHOST=127.0.0.1
As a rule, these tests to not tear down what they have done at the end, so that can be adapted to load database information and code into production systems, as well as testing. If you are running the tests in behaving.trytond, you may have drop the database created in a previous run. This also means that the order of execution of feature files may be important, if one step builds on a previous one, or interferes with it.
We have organized the feature file in directories. In general, you can run all of the feature files within a directory without having to drop the database, bur between directories, you will have to drop the database.
If you set tracer in the scenari section of the configuration file to be pdb, it will drop you into the pdb debugger on an error, if you invoked behave with the --stop flag (stop at the first error). You should also use the behave options --no-capture --no-capture-stderr if you plan to enter the debugger.
Behave is monkey-patched by environment.py to allow backslashes \ at the end of a line in feature files, to allow long verbose steps. Whitespace both sides of the backslash are collapsed to one space.