Documentation
¶
Index ¶
- func AuthenticateHttpRequest(t *testing.T, req *http.Request, user models.User)
- func ClearDBTables() error
- func CreateRequestWithJSONBody(t *testing.T, url, method string, body interface{}) *http.Request
- func SetupDBForTests() error
- func SetupTestEnvironment(t *testing.T) error
- func TeardownTestEnvironment(t *testing.T) error
- func WithSetupAndTearDownTestEnvironment(t *testing.T, testFunc func(t *testing.T))
- type MockEnqueuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateHttpRequest ¶
func ClearDBTables ¶
func ClearDBTables() error
Method that removes all data from all tables in the database
func SetupDBForTests ¶
func SetupDBForTests() error
SetupDBForTests initializes the database with necessary data for tests
func SetupTestEnvironment ¶
func TeardownTestEnvironment ¶
func WithSetupAndTearDownTestEnvironment ¶
Helper function that wraps a test function with setup and teardown of the test environment The setup is done before calling the test function, it initializes the db and clears its contents The teardown is done after the test function returns, it clears the db contents and closes the db connection If setup or teardown fail, the test will fail immediately
Types ¶
Click to show internal directories.
Click to hide internal directories.