Add test for user model

This commit is contained in:
Georges-Antoine Assi
2023-08-13 09:58:17 -04:00
parent 58b7e9adcf
commit d5db3eec25
3 changed files with 11 additions and 3 deletions

View File

@@ -1 +1 @@
from handler.tests.conftest import rom, platform
from handler.tests.conftest import rom, platform, admin_user, editor_user, user # noqa

View File

@@ -1,5 +1,3 @@
from models.rom import Rom
def test_rom(rom):
assert rom.file_path == "test_platform_slug/roms"
assert rom.full_path == "test_platform_slug/roms/test_rom"

View File

@@ -0,0 +1,10 @@
from utils.oauth import DEFAULT_SCOPES, WRITE_SCOPES, FULL_SCOPES
def test_admin_user(admin_user):
admin_user.oauth_scopes == FULL_SCOPES
def test_editor_user(editor_user):
editor_user.oauth_scopes == WRITE_SCOPES
def test_user(user):
user.oauth_scopes == DEFAULT_SCOPES