Document some possible error messages
This commit is contained in:
parent
60fbd09775
commit
e4e3583006
5 changed files with 262 additions and 25 deletions
|
@ -1,9 +1,11 @@
|
|||
# type: ignore
|
||||
|
||||
import abc
|
||||
import dataclasses
|
||||
import datetime
|
||||
import decimal
|
||||
from collections import namedtuple
|
||||
from typing import Optional, Dict, Set, List
|
||||
from typing import Dict, List, Optional, Set
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
@ -372,24 +374,28 @@ def test_raises_error_with_dataclasses(m):
|
|||
address_line_1: str
|
||||
|
||||
with pytest.raises(RedisModelError):
|
||||
|
||||
class InvalidMember(m.BaseHashModel):
|
||||
address: Address
|
||||
|
||||
|
||||
def test_raises_error_with_dicts(m):
|
||||
with pytest.raises(RedisModelError):
|
||||
|
||||
class InvalidMember(m.BaseHashModel):
|
||||
address: Dict[str, str]
|
||||
|
||||
|
||||
def test_raises_error_with_sets(m):
|
||||
with pytest.raises(RedisModelError):
|
||||
|
||||
class InvalidMember(m.BaseHashModel):
|
||||
friend_ids: Set[str]
|
||||
|
||||
|
||||
def test_raises_error_with_lists(m):
|
||||
with pytest.raises(RedisModelError):
|
||||
|
||||
class InvalidMember(m.BaseHashModel):
|
||||
friend_ids: List[str]
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# type: ignore
|
||||
|
||||
import abc
|
||||
import dataclasses
|
||||
import datetime
|
||||
import decimal
|
||||
from collections import namedtuple
|
||||
from typing import List, Optional, Set, Dict
|
||||
from typing import Dict, List, Optional, Set
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
@ -687,7 +689,7 @@ async def test_allows_and_serializes_dicts(m):
|
|||
|
||||
member2 = await ValidMember.get(member.pk)
|
||||
assert member2 == member
|
||||
assert member2.address['address_line_1'] == "hey"
|
||||
assert member2.address["address_line_1"] == "hey"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue