diff options
| author | stuppie | 2026-08-18 19:09:22 -0600 |
|---|---|---|
| committer | stuppie | 2026-08-18 19:09:22 -0600 |
| commit | 28729d407470407bbc78bc7fb6574953b2f03f59 (patch) | |
| tree | 698a5820105f0ff02c93b5205faee7747fcb6ad9 /tests/models/thl/test_user.py | |
| parent | 4d4fce08f3a4c9dbd78fdacf3193b345cf982da3 (diff) | |
| parent | 0742210fc7eaa54d8068bfd18414158dc9b33672 (diff) | |
| download | generalresearch-28729d407470407bbc78bc7fb6574953b2f03f59.tar.gz generalresearch-28729d407470407bbc78bc7fb6574953b2f03f59.zip | |
Merge branch 'master' of ssh://code.g-r-l.com/generalresearch
Diffstat (limited to 'tests/models/thl/test_user.py')
| -rw-r--r-- | tests/models/thl/test_user.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/models/thl/test_user.py b/tests/models/thl/test_user.py index 4f10861..943ae8e 100644 --- a/tests/models/thl/test_user.py +++ b/tests/models/thl/test_user.py @@ -1,7 +1,8 @@ import json -from datetime import datetime, timezone, timedelta +from datetime import datetime, timedelta, timezone from decimal import Decimal -from random import randint, choice as rand_choice +from random import choice as rand_choice +from random import randint from uuid import uuid4 import pytest @@ -100,11 +101,6 @@ class TestUserProductID: assert "1 validation error for User" in str(cm.value) assert "Input should be a valid string" in str(cm.value) - with pytest.raises(expected_exception=ValueError) as cm: - User(user_id=self.user_id, product_id=Decimal("0")) - assert "1 validation error for User" in str(cm.value) - assert "Input should be a valid string" in str(cm.value) - def test_empty(self): from generalresearch.models.thl.user import User @@ -120,8 +116,8 @@ class TestUserProductID: product_id = uuid4().hex[:31] with pytest.raises(expected_exception=ValueError) as cm: User(user_id=self.user_id, product_id=product_id) - assert "1 validation error for User", str(cm.value) - assert "String should have at least 32 characters", str(cm.value) + assert "1 validation error for User" in str(cm.value) + assert "String should have at least 32 characters" in str(cm.value) product_id = uuid4().hex * 2 with pytest.raises(ValueError) as cm: @@ -315,7 +311,7 @@ class TestUserUUID: with pytest.raises(ValueError) as cm: User(user_id=self.user_id, uuid=Decimal("0")) - assert "1 validation error for User", str(cm.value) + assert "1 validation error for User" in str(cm.value) assert "Input should be a valid string" in str(cm.value) def test_empty(self): @@ -323,8 +319,8 @@ class TestUserUUID: with pytest.raises(ValueError) as cm: User(user_id=self.user_id, uuid="") - assert "1 validation error for User", str(cm.value) - assert "String should have at least 32 characters", str(cm.value) + assert "1 validation error for User" in str(cm.value) + assert "String should have at least 32 characters" in str(cm.value) def test_invalid_len(self): from generalresearch.models.thl.user import User |
