Skip to content

Commit b92ca84

Browse files
committed
Update testing of setting user settings
1 parent c4e6727 commit b92ca84

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/test_user.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import pytest
44
from assemblyline_client.v4_client.common.utils import ClientError
55

6+
from assemblyline.odm.models.user_settings import (
7+
DEFAULT_SUBMISSION_PROFILE_SETTINGS,
8+
DEFAULT_USER_PROFILE_SETTINGS,
9+
)
10+
611
try:
712
from utils import random_id_from_collection
813

@@ -140,7 +145,13 @@ def test_settings(datastore, client):
140145

141146
# Test getting settings
142147
settings = client.user.settings(user_id)
143-
assert {'classification', 'download_encoding', 'priority', 'ttl'}.issubset(set(settings.keys()))
148+
149+
# Ensure general settings are present
150+
assert set(DEFAULT_USER_PROFILE_SETTINGS.keys()).issubset(set(settings.keys()))
151+
152+
# Ensure submission settings are present under "submission_profiles"
153+
for submission_profile in settings['submission_profiles'].values():
154+
assert set(DEFAULT_SUBMISSION_PROFILE_SETTINGS.keys()).issubset(set(submission_profile.keys()))
144155

145156
# Test updating settings
146157
new_password = "zippy"

0 commit comments

Comments
 (0)