Documentation
¶
Overview ¶
Package dbtest allows to temporarily add test data to the database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
Error error
// contains filtered or unexported fields
}
Env provides methods to add temporary test data. It collects functions to remove these data. These functions are called by Close, hence a call to Close must be defered for each Env object.
Env's methods never return errors. Instead, the Error field is updated and checked by all methods (except Close).
func (*Env) Close ¶
func (self *Env) Close()
Close calls all collected functions, in reverse order, even if Error is not nil.
func (*Env) CreatePoll ¶
CreatePoll adds a poll to the database. The poll has Salt 42, MaxNbRounds 3, and 2 alternatives 'No' and 'Yes' (in that order). The poll is deleted by Close.
func (*Env) CreateUser ¶
CreateUser adds a user to the database. The user has name ' Test ' (mind the spaces), email address 'test@example.test', and password 'XYZ'. It is deleted by Close.