-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from app.repositories.models import Character | ||
|
||
|
||
class TestBase: | ||
character = Character(id=1) | ||
|
||
def test_to_dict_should_return_dict_with_id_when_id_provided(self): | ||
assert self.character.to_dict() == {"id": 1} | ||
|
||
def test_to_dict_should_return_empty_dict_when_id_provided_and_id_excluded(self): | ||
assert self.character.to_dict(exclude=["id"]) == {} | ||
|
||
def test_to_dict_should_not_return__sa_instance_state_in_dict_when_requested(self): | ||
assert "_sa_instance_state" not in self.character.to_dict() |