Play class date is now a date type
This commit is contained in:
parent
cca5584c74
commit
01d8c769f8
2 changed files with 5 additions and 3 deletions
|
|
@ -22,4 +22,8 @@ class Play(SQLModel, table=True):
|
||||||
ignore_for_stats : bool
|
ignore_for_stats : bool
|
||||||
location: str
|
location: str
|
||||||
|
|
||||||
players: list[PlayPlayer] = Relationship(back_populates="play")
|
players: list[PlayPlayer] = Relationship(back_populates="play")
|
||||||
|
|
||||||
|
model_config = {
|
||||||
|
'validate_assignment':True
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,6 @@ def test_retrieve_plays():
|
||||||
returned_play = play_classes.Play(**response.json()[0])
|
returned_play = play_classes.Play(**response.json()[0])
|
||||||
|
|
||||||
assert type(returned_play.boardgame_id) == int
|
assert type(returned_play.boardgame_id) == int
|
||||||
assert type(returned_play.players) == list
|
|
||||||
assert type(returned_play.players[0]) == play_classes.PlayPlayer
|
|
||||||
assert type(returned_play.play_date) == date
|
assert type(returned_play.play_date) == date
|
||||||
assert type(returned_play.duration) == int
|
assert type(returned_play.duration) == int
|
||||||
assert type(returned_play.ignore_for_stats) == bool
|
assert type(returned_play.ignore_for_stats) == bool
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue