forked from hbeltrane/PyBank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_customer.py
61 lines (51 loc) · 1.42 KB
/
test_customer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
""" Term Project - PyBank
CSD 4523 - Python II
CSAM Group 02 2022S
"""
from datetime import datetime
from model.agent import Agent
from model.customer import Customer
from model.result import Return
from model import util
# Test 1: View Customer
def test_view_customer():
print("* Tests for Customer Model *")
result = Return()
customer_id = 1
customer_view = util.view_customer(customer_id, result)
print(customer_view[0].customer)
def test_update_customer():
result = Return()
active_customer = Customer(
customer_id=11,
pin="1234",
first_name="Juan",
last_name="Casanova",
address="Bentley",
phone_number="9876543210",
email="juan@email.com",
creation_date=datetime.now(),
agent_id='jmisk5'
)
util.update_customer(active_customer, result)
def test_delete_customer():
result = Return()
active_agent = Agent(
username='fbampkin2',
password='Kd2wvlc',
first_name='Feliks',
last_name='Bampkin',
position_id=3
)
active_customer = Customer(
customer_id=16,
pin="1234",
first_name="Juan Luis",
last_name="Casanova",
address="Bentley",
phone_number="9876543210",
email="juan@email.com",
creation_date=datetime.now(),
agent_id='jmisk5'
)
util.delete_customer(active_agent, active_customer, result)