test collaborator`s list on team_id
This commit is contained in:
@@ -41,6 +41,8 @@ def seed(session):
|
||||
[
|
||||
Collaborator(name="Col1", email="aa", phone=1, team_id=1),
|
||||
Collaborator(name="Col2", email="bb", phone=2, team_id=2),
|
||||
Collaborator(name="Col3", email="cc", phone=3, team_id=3),
|
||||
Collaborator(name="Col4", email="dd", phone=4, team_id=2),
|
||||
]
|
||||
)
|
||||
# session.add_all(
|
||||
|
||||
@@ -8,7 +8,7 @@ class TestCustomerTools:
|
||||
|
||||
def test_db_should_be_populated(self, seed, session):
|
||||
test = session.query(Customer).all()
|
||||
# print(test)
|
||||
assert test != None
|
||||
|
||||
def test_list_should_return_all_customers(self, seed, session):
|
||||
tools = CustomerTools(session)
|
||||
@@ -31,7 +31,18 @@ class TestCollaboratorTools:
|
||||
assert reply == 1
|
||||
|
||||
def test_should_reply_id_by_team_id(self, seed, session):
|
||||
pass
|
||||
tool = CollaboratorTools(session)
|
||||
reply = tool.get_by_team_id(1)
|
||||
assert len(reply) == 1
|
||||
reply = tool.get_by_team_id(2)
|
||||
assert len(reply) == 2
|
||||
|
||||
def test_should_reply_team_id_by_name(self, seed, session):
|
||||
tool = CollaboratorTools(session)
|
||||
reply = tool.get_team_by_name("Col1")
|
||||
reply2 = tool.get_team_by_name("Col2")
|
||||
assert reply == 1
|
||||
assert reply2 == 2
|
||||
|
||||
class TestPasswordTools:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user