Utilities for Testing¶

To read about the in-memory database used for testing without the local/remote database, see tests.memorydb.MemoryDB.

Some important (and often-used) utility functions.

tests.util.create_test_admin(slack_id)¶

Create a test admin user with slack id, and with all other attributes set.

Property

Preset

Slack ID

slack_id

Bio

I like puppies and kittens!

Email

admin@ubc.ca

Name

Iemann Atmin

Github

kibbles

Github ID

123453

Image URL

https://via.placeholder.com/150

Major

Computer Science

Permission

Admin

Position

Adrenaline Junkie

Parameters

slack_id (str) – The slack id string

Return type

app.model.user.User

Returns

a filled-in user model (no empty strings)

tests.util.create_test_team(tid, team_name, display_name)¶

Create a test team with team name, and with all other attributes the same.

Property

Preset

Github

tid

Name slug

team_name

Display

display_name

Platform

slack

Members

[‘abc_123’]

Parameters
  • tid (str) – The github ID associated with the team

  • team_name (str) – The github team name slug

  • display_name (str) – The github team name

Return type

app.model.team.Team

Returns

a filled-in team model (no empty strings)